]> git.cworth.org Git - apitrace/commitdiff
Conditional build of d3d8/d3d9.dll.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 13 Apr 2009 13:05:28 +0000 (14:05 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 13 Apr 2009 13:05:28 +0000 (14:05 +0100)
SConstruct

index 54a2139d654cbcf281672fb6ead78f8b1e2affde..1c308bdad64b1840fabcd2e685c315984562cb47 100644 (file)
@@ -82,39 +82,46 @@ env.Append(CPPPATH = [
     os.path.join(env['dxsdk'], 'Include'),
 ])
 
-env.Command(
-    target = 'd3d8.cpp', 
-    source = ['d3d8.py', 'd3d8types.py', 'd3d8caps.py', 'windows.py', 'base.py'],
-    action = 'python $SOURCE > $TARGET',
-)
-    
-d3d8 = env.SharedLibrary(
-    target = 'd3d8',
-    source = [
-        'd3d8.def',
-        'd3d8.cpp',
-        'log.cpp',
-    ]
-)
-
-env.Default(d3d8)
-
-env.Command(
-    target = 'd3d9.cpp', 
-    source = ['d3d9.py', 'd3d9types.py', 'd3d9caps.py', 'windows.py', 'base.py'],
-    action = 'python $SOURCE > $TARGET',
-)
-    
-d3d9 = env.SharedLibrary(
-    target = 'd3d9',
-    source = [
-        'd3d9.def',
-        'd3d9.cpp',
-        'log.cpp',
-    ]
-)
-
-env.Default(d3d9)
+conf = Configure(env)
+has_d3d9 = conf.CheckCHeader('d3d9.h')
+has_d3d8 = conf.CheckCHeader('d3d8.h')
+env = conf.Finish()
+
+if has_d3d8:
+    env.Command(
+        target = 'd3d8.cpp', 
+        source = ['d3d8.py', 'd3d8types.py', 'd3d8caps.py', 'windows.py', 'base.py'],
+        action = 'python $SOURCE > $TARGET',
+    )
+        
+    d3d8 = env.SharedLibrary(
+        target = 'd3d8',
+        source = [
+            'd3d8.def',
+            'd3d8.cpp',
+            'log.cpp',
+        ]
+    )
+
+    env.Default(d3d8)
+
+if has_d3d9:
+    env.Command(
+        target = 'd3d9.cpp', 
+        source = ['d3d9.py', 'd3d9types.py', 'd3d9caps.py', 'windows.py', 'base.py'],
+        action = 'python $SOURCE > $TARGET',
+    )
+        
+    d3d9 = env.SharedLibrary(
+        target = 'd3d9',
+        source = [
+            'd3d9.def',
+            'd3d9.cpp',
+            'log.cpp',
+        ]
+    )
+
+    env.Default(d3d9)
 
 env.Tool('packaging')