From d6c2c83bb6f6789569eb76ecd03892c4054e5b03 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Tue, 11 Dec 2012 19:55:34 +0100 Subject: [PATCH] Fix '-fno-rtti' removal for tablegen tools. Also just remove it on pre-3.2 builds. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13a225d7..b4adf979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,10 @@ add_executable(gen_gccbuiltins utils/gen_gccbuiltins.cpp) # Prior to LLVM 3.2, TableGen still uses RTTI, contrary to the rest of LLVM. # Thus, we have to remove the -fno-rtti flag from the llvm-config output. -string(REPLACE "-fno-rtti " "" TABLEGEN_CXXFLAGS ${LLVM_CXXFLAGS}) +set(TABLEGEN_CXXFLAGS "${LLVM_CXXFLAGS}") +if(${LDC_LLVM_VER} LESS 302) + string(REPLACE "-fno-rtti" "" TABLEGEN_CXXFLAGS ${TABLEGEN_CXXFLAGS}) +endif() set_target_properties( gen_gccbuiltins PROPERTIES