如果CMAKE_BUILD_TYPE为空,C / C ++构建会发生什么? [英] What happens for C/C++ builds if CMAKE_BUILD_TYPE is empty?
问题描述
当变量 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屋!