What happens for C/C++ builds if CMAKE_BUILD_TYPE

2019-02-18 14:43发布

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?

标签: cmake
1条回答
干净又极端
2楼-- · 2019-02-18 15:10

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.

查看更多
登录 后发表回答