scons: Don't raise an exception when DXSDK is not found.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 29 Jun 2009 11:56:47 +0000 (12:56 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 29 Jun 2009 11:56:47 +0000 (12:56 +0100)
Unfortunately scons does not check if a tool exists before it invokes
its generate function.

scons/dxsdk.py

index a369e1da10ce906694e3d736eafecd98eb24a3e9..de090e4f991aa5356980e88619d12b1d7d9f8d9a 100644 (file)
@@ -40,10 +40,11 @@ def get_dxsdk_root(env):
     except KeyError:
         return None
 
-def get_dxsdk_paths(env):
+def generate(env):
     dxsdk_root = get_dxsdk_root(env)
     if dxsdk_root is None:
-        raise SCons.Errors.InternalError, "DirectX SDK not found"
+        # DirectX SDK not found
+        return
 
     if env['machine'] in ('generic', 'x86'):
         target_cpu = 'x86'
@@ -57,9 +58,6 @@ def get_dxsdk_paths(env):
     env.Prepend(CPPPATH = [os.path.join(dxsdk_root, 'Include')])
     env.Prepend(LIBPATH = [os.path.join(dxsdk_root, 'Lib', target_cpu)])
 
-def generate(env):
-    get_dxsdk_paths(env)
-
 def exists(env):
     return get_dxsdk_root(env) is not None