[PATCH] D75328: [cmake] Fix LLVM_USE_SPLIT_DWARF

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 11:01:23 PST 2020


hliao updated this revision to Diff 247319.
hliao added a comment.

Apply to objc and objcxx.


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
@@ -747,8 +747,12 @@
 endif()
 
 # Turn on -gsplit-dwarf if requested
-if(LLVM_USE_SPLIT_DWARF)
-  add_definitions("-gsplit-dwarf")
+if (LLVM_USE_SPLIT_DWARF)
+  # 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($<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-gsplit-dwarf>)
+  endif()
 endif()
 
 add_definitions( -D__STDC_CONSTANT_MACROS )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75328.247319.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200228/9ea54da9/attachment.bin>


More information about the llvm-commits mailing list