简体   繁体   中英

Visual Studio C++ - change main.cpp file for each build solution configuration

I need to change default(main.cpp) file for each build configuration.

Two cpp files

  1. main.cpp - created on project creation time
  2. second.cpp

Two build configurations.

  1. Release - compiling main.cpp
  2. Custom - also compiling main.cpp but i need to compile second.cpp

How can i do this? Thank you very much.

Answer provided by Richard Critten:

Right click the file > Properties > General > Exclude from build

This excludes the file from the build for the currently selected configuration at the top of the dialog. You can create as many custom configurations as you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM