Build specific .cpps

Can anyone point out where in Visual Studio 2008 configurations I can set which .cpp files are used for this assembly.

I would like to use a different set of .cpp files when I build vs .debug for release.

Thanks!

+4
source share
3 answers

It is best to achieve this behavior by using #ifdef blocks to distinguish between debug and release code.

As a last resort, you can #ifdef a #include line of code that selectively includes other files.

I don’t know the normal way to dynamically change .cpp files compiled in a project based on assembly type.

+1
source

I can open the property pages for any specific .cpp file in VS2008 (from Solution Explorer). One of the properties in the general section excludes yes / no from the assembly. All these properties are configured by type of assembly.

I used this to exclude some debugging support files in release versions.

+1
source

Select a configuration from the Solution Configurations drop-down list and platform from the Solution Platform ) on the standard toolbar. Right-click the cpp file and select Properties . On the General branch, set the Excluded from assembly property to Yes or No.

+1
source

Source: https://habr.com/ru/post/1309051/


All Articles