如果CMAKE_BUILD_TYPE为空,C / C ++构建会发生什么? [英] What happens for C/C++ builds if CMAKE_BUILD_TYPE is empty?

查看:884
本文介绍了如果CMAKE_BUILD_TYPE为空,C / C ++构建会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当变量 CMAKE_BUILD_TYPE 为空时使用哪个编译器标志?那么编译器是否只需对C ++和C?使用 CMAKE_CXX_FLAGS CMAKE_C_FLAGS

When the variable CMAKE_BUILD_TYPE is empty which compiler flags are used? Does the compiler then simply use CMAKE_CXX_FLAGS and CMAKE_C_FLAGS for C++ and C?

推荐答案

默认值将是空或调试,具体取决于编译器。该变量的值将仅在使用SOME_VAR _ $ {CONFIG}的地方感兴趣。所以回答你的问题。从我的理解,可以添加调试标志。文档( http://www.cmake.org/cmake/ help / v3.3 / variable / CMAKE_BUILD_TYPE.html )不太清楚。

The default will be "empty" or "Debug" depending on the compiler. The value of the variable will be only of interest in places where SOME_VAR_${CONFIG} is used. So to answer your question. From my understanding the debug flags could be added. The documentation (http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_BUILD_TYPE.html) is unfortunately not so clear.

这篇关于如果CMAKE_BUILD_TYPE为空,C / C ++构建会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆