[PATCH] D75328: [cmake] Fix LLVM_USE_SPLIT_DWARF
Michael Liao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 28 12:21:48 PST 2020
hliao updated this revision to Diff 247343.
hliao added a comment.
That makes sense to me. At least, in release build, we won't generate
unnecessary files.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75328/new/
https://reviews.llvm.org/D75328
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -746,9 +746,15 @@
endif()
endif()
-# Turn on -gsplit-dwarf if requested
-if(LLVM_USE_SPLIT_DWARF)
- add_definitions("-gsplit-dwarf")
+# Turn on -gsplit-dwarf if requested in debug builds.
+if (LLVM_USE_SPLIT_DWARF AND
+ ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
+ (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
+ # Limit to clang and gcc so far. Add compilers supporting this option.
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ add_compile_options(-gsplit-dwarf)
+ endif()
endif()
add_definitions( -D__STDC_CONSTANT_MACROS )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75328.247343.patch
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200228/304bf508/attachment.bin>
More information about the llvm-commits
mailing list