C# command line build fails when using wildcards for sources
In my project, about 3000 .cs
files are produced via the UseSWIG
module.
Unfortunately the filenames of all the generated files are not known in advance, as a result I set the source files to the add_library()
as *.cs
but this has some side effects on the command line build in that the *.cs
is completely omitted from the build cmd.
CoreCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /nowarn:17
01,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:3 /define:TRACE;DEBUG /highentropyva- /reference:"C:\Progr
am Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files
(x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /debug+ /debug:full /optimize- /o
ut:obj\Win32\Debug\example.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\
Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /target:library /utf8output /langversion:3
Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2017\Profession
al\MSBuild\15.0\Bin\Roslyn
CSC : warning CS2008: No source files specified. [F:\Swig\build\example.csproj]
Resulting in the above warning. All that is missing is F:\Swig\build\*.cs
& if I try add it manually to the above call, then it works.
Another point to note is that Visual Studio C# project files support specifying wildcards. So building with the IDE works fine.
If you would like to reproduce the issue, I have an example project here.