anv: fix python whitespace warning
[mesa.git] / scons / llvm.py
index eaa2ecbe026cdcfe3d129e00f96cfe76968258a9..a34edfb4b67148f5ac908a54532f6f0575010bd6 100644 (file)
@@ -50,7 +50,7 @@ def generate(env):
         llvm_dir = None
     else:
         if not os.path.isdir(llvm_dir):
-            raise SCons.Errors.InternalError, "Specified LLVM directory not found"
+            raise SCons.Errors.InternalError("Specified LLVM directory not found")
 
         if env['debug']:
             llvm_subdir = 'Debug'
@@ -61,7 +61,7 @@ def generate(env):
         if not os.path.isdir(llvm_bin_dir):
             llvm_bin_dir = os.path.join(llvm_dir, 'bin')
             if not os.path.isdir(llvm_bin_dir):
-                raise SCons.Errors.InternalError, "LLVM binary directory not found"
+                raise SCons.Errors.InternalError("LLVM binary directory not found")
 
         env.PrependENVPath('PATH', llvm_bin_dir)
 
@@ -123,6 +123,10 @@ def generate(env):
                 'LLVMDemangle', 'LLVMGlobalISel', 'LLVMDebugInfoMSF',
                 'LLVMBinaryFormat',
             ])
+            if env['platform'] == 'windows' and env['crosscompile']:
+                # LLVM 5.0 requires MinGW w/ pthreads due to use of std::thread and friends.
+                assert env['gcc']
+                env['CXX'] = env['CXX'] + '-posix'
         elif llvm_version >= distutils.version.LooseVersion('4.0'):
             env.Prepend(LIBS = [
                 'LLVMX86Disassembler', 'LLVMX86AsmParser',
@@ -211,8 +215,11 @@ def generate(env):
             'imagehlp',
             'psapi',
             'shell32',
-            'advapi32'
+            'advapi32',
+            'ole32',
+            'uuid',
         ])
+
         if env['msvc']:
             # Some of the LLVM C headers use the inline keyword without
             # defining it.