llvm.org GIT mirror llvm / c49768f
[CMake] Add an LLVM_ENABLE_MODULE_DEBUGGING flag for building with -gmodules. This flag is only effective in builds with debug info and modules. The default is On for Darwin only. rdar://problem/27019000 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274244 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian Prantl 4 years ago
2 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
283283 option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
284284 option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF)
285285 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
286 option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
286287 option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." OFF)
287288 else()
289 option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." OFF)
288290 option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." ON)
289291 endif()
290292 option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
472472 if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
473473 set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
474474 endif()
475 if (LLVM_ENABLE_MODULE_DEBUGGING AND
476 ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
477 (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
478 set(module_flags "${module_flags} -gmodules")
479 endif()
475480 set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")
476481
477482 # Check that we can build code with modules enabled, and that repeatedly