llvmpipe: new comment
[mesa.git] / scons / llvm.py
index 73e9310f71b44ec0cf45a0f0bc199ad92f1b3089..37c503ec986dd959104dae30392979bef7c3b8fc 100644 (file)
@@ -58,45 +58,58 @@ def generate(env):
 
         env.PrependENVPath('PATH', llvm_bin_dir)
 
-    if env['msvc']:
+    if env['platform'] == 'windows':
         # XXX: There is no llvm-config on Windows, so assume a standard layout
         if llvm_dir is not None:
             env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
+            env.AppendUnique(CPPDEFINES = [
+                '__STDC_LIMIT_MACROS', 
+                '__STDC_CONSTANT_MACROS',
+                'HAVE_STDINT_H',
+            ])
             env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
             env.Prepend(LIBS = [
+                'LLVMX86AsmParser',
+                'LLVMX86AsmPrinter',
+                'LLVMX86CodeGen',
+                'LLVMX86Info',
+                'LLVMLinker',
+                'LLVMipo',
+                'LLVMInterpreter',
+                'LLVMInstrumentation',
+                'LLVMJIT',
+                'LLVMExecutionEngine',
+                'LLVMDebugger',
                 'LLVMBitWriter',
-                'LLVMCore',
-                'LLVMSupport',
-                'LLVMSystem',
-                'LLVMSupport',
-                'LLVMSystem',
-                'LLVMCore',
-                'LLVMCodeGen',
+                'LLVMAsmParser',
+                'LLVMArchive',
+                'LLVMBitReader',
                 'LLVMSelectionDAG',
                 'LLVMAsmPrinter',
-                'LLVMBitReader',
-                'LLVMBitWriter',
-                'LLVMTransformUtils',
-                'LLVMInstrumentation',
+                'LLVMCodeGen',
                 'LLVMScalarOpts',
-                'LLVMipo',
-                'LLVMHello',
-                'LLVMLinker',
-                'LLVMAnalysis',
+                'LLVMTransformUtils',
                 'LLVMipa',
-                'LLVMX86CodeGen',
-                'LLVMX86AsmPrinter',
-                'LLVMExecutionEngine',
-                'LLVMInterpreter',
-                'LLVMJIT',
+                'LLVMAnalysis',
                 'LLVMTarget',
-                'LLVMAsmParser',
-                'LLVMDebugger',
-                'LLVMArchive',
+                'LLVMMC',
+                'LLVMCore',
+                'LLVMSupport',
+                'LLVMSystem',
                 'imagehlp',
                 'psapi',
             ])
-            env['LLVM_VERSION'] = '2.5'
+            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'):
         version = env.backtick('llvm-config --version').rstrip()