summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-06-30 17:15:44 +0000
committerAdrian Prantl <aprantl@apple.com>2016-06-30 17:15:44 +0000
commitc49768f9724bb90be0f6a0e4dc77e77512a11318 (patch)
tree45ef30f21077780f2ab0bba1cf4573af9d2c9c10 /cmake
parent39952bd72b0964de3b1d53bcaec53516244b2872 (diff)
[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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 675bba6ab36..22b4408b1ac 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -473,6 +473,11 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
endif()
+ if (LLVM_ENABLE_MODULE_DEBUGGING AND
+ ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
+ (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
+ set(module_flags "${module_flags} -gmodules")
+ endif()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")
# Check that we can build code with modules enabled, and that repeatedly