I put together a sample solution containing one C++ project (.vcxproj). The project include two folders (Dir1 & Dir2) that each contain two source code files. The project contains configurations that will build a console application from the source files in either Dir1 or Dir2 for Debug/Release and x86/x64. The console application prints the platform, configuration and source files that were used to build it to the console. You can get it from OneDrive at https://1drv.ms/u/s!AmnqrCFBv4nDgji0Z8lEhRX0RBtq?e=RUcaGf
How to include different source files for different configurations of a single .VcxProj
msr
21
Reputation points
Hi
I have a .SLN with 2 .Vcxproj (LIB and a driver). My .VcxProjs has 2 configurations.
For one of the configuraion I need the sources files from dir1 to be used. For other configuration I need the source files from dir2 to be used.
Both the dirs have same file names. I can't combine above 2 dirs or have single dir with those files.
Anyway to have a configuration of an .vcxproj to selectively pickup the src files to compile given above preconditions and dir-structure?
Also I would like the files from both dirs to be listed in teh solution explorer.
Thanks