scons: Simplified fix of llvm cxxflags for rtti
authorAlexander von Gluck IV <kallisti5@unixzen.com>
Thu, 17 Oct 2013 01:24:13 +0000 (20:24 -0500)
committerAlexander von Gluck IV <kallisti5@unixzen.com>
Fri, 18 Oct 2013 01:33:05 +0000 (20:33 -0500)
* Based on ideas of Jose Fonseca
* A rework of ce8eadb6e8

Tested-by: Vinson Lee <vlee@freedesktop.org>
scons/llvm.py

index c1c37362d3c464902ed679edc8ada222739c1c02..8388d8e9fc2b35ce5f7c4931a23f09d0fd66a7c2 100644 (file)
@@ -190,6 +190,11 @@ def generate(env):
                 pass
             env.MergeFlags(cppflags)
 
+            # Match llvm --fno-rtti flag
+            cxxflags = env.backtick('llvm-config --cxxflags').split()
+            if '-fno-rtti' in cxxflags:
+                env.Append(CXXFLAGS = ['-fno-rtti'])
+
             components = ['engine', 'bitwriter', 'x86asmprinter']
 
             if llvm_version >= distutils.version.LooseVersion('3.1'):