scons: Don't use bundled C99 headers for VS 2013.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 1 May 2014 13:19:13 +0000 (14:19 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 2 May 2014 21:04:46 +0000 (22:04 +0100)
Use the ones provided by the compiler instead.

NOTE: External trees should be updated to not include '#include/c99'
directory directly, but rather rely on scons/gallium.py to do the right
thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
SConstruct
scons/gallium.py

index 0e10818ba17bd3e4b840b8b944f343f9f9f6d406..ef71ab69c3844cd0a3837f76f34d639ea460cd79 100644 (file)
@@ -80,9 +80,6 @@ env.Append(CPPPATH = [
        '#/src/gallium/winsys',
 ])
 
-if env['msvc']:
-    env.Append(CPPPATH = ['#include/c99'])
-
 # for debugging
 #print env.Dump()
 
@@ -115,9 +112,6 @@ if env['crosscompile'] and not env['embedded']:
     host_env['hostonly'] = True
     assert host_env['crosscompile'] == False
 
-    if host_env['msvc']:
-        host_env.Append(CPPPATH = ['#include/c99'])
-
     target_env = env
     env = host_env
     Export('env')
index ca317b0cfdc2bf840355ee4e3dd7c0f119ff0a7a..5109ebffee0f10888972b8cdef91a2435fb48aba 100755 (executable)
@@ -433,6 +433,12 @@ def generate(env):
         # See also:
         # - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
         # - cl /?
+        if 'MSVC_VERSION' not in env or distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('12.0'):
+            # Use bundled stdbool.h and stdint.h headers for older MSVC
+            # versions.  stdint.h was introduced in MSVC 2010, but stdbool.h
+            # was only introduced in MSVC 2013.
+            top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+            env.Append(CPPPATH = [os.path.join(top_dir, 'include/c99')])
         if env['build'] == 'debug':
             ccflags += [
               '/Od', # disable optimizations