[Parallel_libs-commits] [PATCH] D24474: [SE] Stop using llvm-config --cxxflags

Jason Henline via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Mon Sep 12 15:45:12 PDT 2016


jhen updated this revision to Diff 71065.
jhen added a comment.

- LLVM_ENABLE_RTTI


https://reviews.llvm.org/D24474

Files:
  streamexecutor/CMakeLists.txt

Index: streamexecutor/CMakeLists.txt
===================================================================
--- streamexecutor/CMakeLists.txt
+++ streamexecutor/CMakeLists.txt
@@ -26,17 +26,10 @@
     include_directories(${LLVM_INCLUDE_DIRS})
     add_definitions(${LLVM_DEFINITIONS})
 
-    # Get the LLVM cxxflags by using llvm-config.
-    #
-    # This is necessary to get -fno-rtti if LLVM is compiled that way.
-    execute_process(
-        COMMAND
-        "${LLVM_BINARY_DIR}/bin/llvm-config"
-        --cxxflags
-        OUTPUT_VARIABLE
-        LLVM_CXXFLAGS
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXXFLAGS}")
+    # If LLVM does not have RTTI, don't use it here either.
+    if (NOT LLVM_ENABLE_RTTI)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+    endif()
 
     set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
     list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24474.71065.patch
Type: text/x-patch
Size: 982 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/parallel_libs-commits/attachments/20160912/e3cf4582/attachment.bin>


More information about the Parallel_libs-commits mailing list