开发者

Include/exclude files depending on target (Visual Studio)

开发者 https://www.devze.com 2022-12-16 21:15 出处:网络
Is it possible to include/exclude certain source files depending on what ta开发者_开发百科rget is selected in Visual Studio? If possible, how?You can do this by having a define in the beginning of the

Is it possible to include/exclude certain source files depending on what ta开发者_开发百科rget is selected in Visual Studio? If possible, how?


You can do this by having a define in the beginning of the relevant source files. Add a unique identifier to each build configuration, and wrap your source file with:

#if _MY_IDENTIFER
...
#endif

If you want a more robust way, switch so by using nant


Yes it is possible. Right click on the file you want to exclude and select Properties. You can now set Action to None according to the target.

0

精彩评论

暂无评论...
验证码 换一张
取 消