简体   繁体   English

为C ++项目同时编译发布和调试

[英]Compile release and debug at the same time for a C++ project

Is it possible to compile release and debug versions at the same time (different tabs) in a C++ project? 是否可以在C ++项目中同时编译发布和调试版本(不同的选项卡)?

I've tried doing this, with both SCons and Ninja, and I had no problems. 我已经尝试过用SCons和Ninja做这个,我没有遇到任何问题。 I worry that something I'm not aware of is happening and there will be downstream problems... 我担心我不知道的事情正在发生,并且会出现下游问题......

Yes, simultaneous builds using different configurations are done all the time. 是的,使用不同配置的同时构建始终是完成的。 (Well, perhaps not simultaneous , but certainly one right after the other.) In Visual Studio, there is a built-in command to do this called "Batch Build". (好吧,也许不是同时发生 ,但肯定是一个接一个。)在Visual Studio中,有一个内置命令来执行此操作,称为“批量构建”。 Presumably other IDEs have something similar, and certainly MAKE files support building multiple configurations at one go. 据推测,其他IDE有类似的东西,当然MAKE文件支持一次构建多个配置。

The thing to remember is, like Serge said, to keep the output files in separate folders. 需要记住的是,像Serge说的那样,要将输出文件保存在单独的文件夹中。 That should be the default in your build environment or IDE. 这应该是构建环境或IDE中的默认值。 There is never a reason to mix these up. 没有理由混淆这些。 Keep the Debug and Release output (binaries, symbols, temp files, etc.) separated. 保持Debug和Release输出(二进制文件,符号,临时文件等)分开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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