scons: drop unused HAVE_STDINT_H macro
[mesa.git] / scons / llvm.py
index eaa2ecbe026cdcfe3d129e00f96cfe76968258a9..a84ad51d97a7d06af1079dbc0ad4ff89524ac91f 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)
 
@@ -99,9 +99,6 @@ def generate(env):
             return
 
         env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
-        env.AppendUnique(CPPDEFINES = [
-            'HAVE_STDINT_H',
-        ])
         env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
         # LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter irreader`
         if llvm_version >= distutils.version.LooseVersion('5.0'):
@@ -123,6 +120,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 +212,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.