Index: streamexecutor/CMakeLists.txt =================================================================== --- streamexecutor/CMakeLists.txt +++ streamexecutor/CMakeLists.txt @@ -26,17 +26,17 @@ 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. + # If LLVM does not have RTTI, don't use it here either. execute_process( COMMAND "${LLVM_BINARY_DIR}/bin/llvm-config" - --cxxflags + --has-rtti OUTPUT_VARIABLE - LLVM_CXXFLAGS + STREAM_EXECUTOR_LLVM_HAS_RTTI OUTPUT_STRIP_TRAILING_WHITESPACE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXXFLAGS}") + if (NOT STREAM_EXECUTOR_LLVM_HAS_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}")