I want to include a file in the project only under the 'Debug' build configuration and not in the 'Release' build. How can I do that via the IDE?
I am already able to achieve the above by manually editing the '*.vcxproj ' file.
<ClCompile Include="..\..\..\..\dbg_helper.c" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"/>
I am using Microsoft Visual Studio Express 2013 for Windows Desktop (Version 12.0.21005.1 REL).
On the menu bar, choose Build > Configuration Manager. In the Project contexts table, locate the project you want to exclude from the build. In the Build column for the project, clear the check box. Choose the Close button, and then rebuild the solution.
We can right click on the file, choose properties, go to General and click on Excluded From Build, then choose Yes or No to exclude or re-include.
Right click on the User Source Files folder and choose one of the Files to Source File Folder menus to open a file dialog. The Copy menu copies the source file to the project folder and adds it to the project list. The Add function adds the file and its path without moving it to the project folder.
If you only want to exclude it from the build and not from the entire project tree, you can do it from UI.
Just edit the file properties.
Now, you can change to the desired configuration, for which you want to edit its properties.
Exclude your file for all configurations and platforms. And then include it only for the configuration you want it to build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With