Mesa (gallium-0.1): scons: Choose the appropriate MSVC CRT.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jan 6 18:35:46 UTC 2009


Module: Mesa
Branch: gallium-0.1
Commit: 26ba5ce0e8fc54d330a0f26d0c5ab76e250fae3a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=26ba5ce0e8fc54d330a0f26d0c5ab76e250fae3a

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Jan  6 16:16:38 2009 +0000

scons: Choose the appropriate MSVC CRT.

---

 scons/gallium.py |   10 ++++++++++
 scons/generic.py |   10 ++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/scons/gallium.py b/scons/gallium.py
index 19eeb18..33bd65d 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -390,6 +390,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':
diff --git a/scons/generic.py b/scons/generic.py
index f0bb3de..0ed21a4 100644
--- a/scons/generic.py
+++ b/scons/generic.py
@@ -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':




More information about the mesa-commit mailing list