scons: Fix MinGW cross compilation with LLVM 5.0.
authorJose Fonseca <jfonseca@vmware.com>
Fri, 1 Jun 2018 18:57:31 +0000 (19:57 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Sat, 2 Jun 2018 08:58:50 +0000 (09:58 +0100)
LLVM 5.0 requires additional Win32 libraries, and MinGW with pthreads.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
scons/llvm.py

index 79118be371d113c81e048ef0ae10d65f03022fa7..a34edfb4b67148f5ac908a54532f6f0575010bd6 100644 (file)
@@ -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.