scons: LLVM <-> MSVC integration tweaks.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 10 Jan 2010 10:51:42 +0000 (10:51 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 10 Jan 2010 10:51:42 +0000 (10:51 +0000)
scons/llvm.py

index 5b9c82f11033555789421621bca12461a5d60920..37c503ec986dd959104dae30392979bef7c3b8fc 100644 (file)
@@ -99,6 +99,16 @@ def generate(env):
                 'imagehlp',
                 'psapi',
             ])
+            if env['msvc']:
+                # Some of the LLVM C headers use the inline keyword without
+                # defining it.
+                env.Append(CPPDEFINES = [('inline', '__inline')])
+                if env['debug']:
+                    # LLVM libraries are static, build with /MT, and they
+                    # automatically link agains LIBCMT. When we're doing a
+                    # debug build we'll be linking against LIBCMTD, so disable
+                    # that.
+                    env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT'])
             env['LLVM_VERSION'] = '2.6'
         return
     elif env.Detect('llvm-config'):