summaryrefslogtreecommitdiff
path: root/scons/dxsdk.py
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-09-01 10:11:08 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-09-14 20:12:01 +0100
commita4a4553a80e62f0d339d18a91c0ce699b0e196d4 (patch)
treed1ff39e4e1694079c787f5b74a8e03b749272be2 /scons/dxsdk.py
parentc51bd94a14c133d44115d52e4773cb7b313c3ce7 (diff)
scons: Allow to use MS's DXSDK headers with MinGW.
Diffstat (limited to 'scons/dxsdk.py')
-rw-r--r--scons/dxsdk.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/scons/dxsdk.py b/scons/dxsdk.py
index de090e4f991..920cc2f689d 100644
--- a/scons/dxsdk.py
+++ b/scons/dxsdk.py
@@ -52,11 +52,20 @@ def generate(env):
target_cpu = 'x64'
else:
raise SCons.Errors.InternalError, "Unsupported target machine"
- include_dir = 'Include'
+
+ include_dir = os.path.join(dxsdk_root, 'Include')
+ lib_dir = os.path.join(dxsdk_root, 'Lib', target_cpu)
env.Append(CPPDEFINES = [('HAVE_DXSDK', '1')])
- env.Prepend(CPPPATH = [os.path.join(dxsdk_root, 'Include')])
- env.Prepend(LIBPATH = [os.path.join(dxsdk_root, 'Lib', target_cpu)])
+
+ gcc = 'gcc' in os.path.basename(env['CC']).split('-')
+ if gcc:
+ # Make GCC more forgiving towards Microsoft's headers
+ env.Prepend(CPPFLAGS = ['-isystem', include_dir])
+ else:
+ env.Prepend(CPPPATH = [include_dir])
+
+ env.Prepend(LIBPATH = [lib_dir])
def exists(env):
return get_dxsdk_root(env) is not None