scons: Choose the appropriate MSVC CRT.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 6 Jan 2009 16:16:38 +0000 (16:16 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Jan 2009 12:05:03 +0000 (12:05 +0000)
scons/gallium.py
scons/generic.py

index 92cafa27e0c1b33899fe23fb5f940bd7bf292644..3d5a0532eca9c53232ba0f1fdc8bfd4c3ab34c2f 100644 (file)
@@ -392,6 +392,16 @@ def generate(env):
     env.Append(CFLAGS = cflags)
     env.Append(CXXFLAGS = cflags)
 
+    if env['platform'] == 'windows' and msvc:
+        # Choose the appropriate MSVC CRT
+        # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
+        if env['debug']:
+            env.Append(CCFLAGS = ['/MTd'])
+            env.Append(SHCCFLAGS = ['/LDd'])
+        else:
+            env.Append(CCFLAGS = ['/MT'])
+            env.Append(SHCCFLAGS = ['/LD'])
+    
     # Assembler options
     if gcc:
         if env['machine'] == 'x86':
index f0bb3de9fcd43ac410b3b9b20408d6c3e21bbda0..0ed21a4e6ce13ed5e3db47ef01860ac3e349dd3e 100644 (file)
@@ -458,6 +458,16 @@ def generate(env):
     env.Append(CFLAGS = cflags)
     env.Append(CXXFLAGS = cflags)
 
+    if env['platform'] == 'windows' and msvc:
+        # Choose the appropriate MSVC CRT
+        # http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
+        if env['debug']:
+            env.Append(CCFLAGS = ['/MTd'])
+            env.Append(SHCCFLAGS = ['/LDd'])
+        else:
+            env.Append(CCFLAGS = ['/MT'])
+            env.Append(SHCCFLAGS = ['/LD'])
+    
     # Assembler options
     if gcc:
         if env['machine'] == 'x86':