OSDN Git Service

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 92cafa2..3d5a053 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 f0bb3de..0ed21a4 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':