summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-04-02 18:09:37 -0400
committerAndrew Morrow <acm@10gen.com>2013-04-26 11:45:36 -0400
commit4a27c920158de92bff2fb4b55bd8c210e0995b39 (patch)
treedb931af0fc772240229e70993ae9384ba117382d /SConstruct
parent128b0cb3b421ec91e93402a5b275b4b97a158eaf (diff)
downloadmongo-4a27c920158de92bff2fb4b55bd8c210e0995b39.tar.gz
Rely more exclusively on SCons to locate MS tools
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct21
1 files changed, 4 insertions, 17 deletions
diff --git a/SConstruct b/SConstruct
index c72ec372a05..43602a731f5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -505,15 +505,6 @@ isBuildingLatest = False
if has_option( "prefix" ):
installDir = GetOption( "prefix" )
-def findVersion( root , choices ):
- if not isinstance(root, list):
- root = [root]
- for r in root:
- for c in choices:
- if ( os.path.exists( r + c ) ):
- return r + c
- raise RuntimeError("can't find a version of [" + repr(root) + "] choices: " + repr(choices))
-
def filterExists(paths):
return filter(os.path.exists, paths)
@@ -610,23 +601,19 @@ elif "win32" == os.sys.platform:
print("Can't specify both 'win-version-min' and 'win2008plus'")
Exit(1)
+ # If tools configuration fails to set up 'cl' in the path, fall back to importing the whole
+ # shell environment and hope for the best. This will work, for instance, if you have loaded
+ # an SDK shell.
for pathdir in env['ENV']['PATH'].split(os.pathsep):
if os.path.exists(os.path.join(pathdir, 'cl.exe')):
- print( "found visual studio at " + pathdir )
break
else:
- #use current environment
+ print("NOTE: Tool configuration did not find 'cl' compiler, falling back to os environment")
env['ENV'] = dict(os.environ)
env.Append( CPPDEFINES=[ "_UNICODE" ] )
env.Append( CPPDEFINES=[ "UNICODE" ] )
- winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] ,
- [ "v7.1", "v7.0A", "v7.0", "v6.1", "v6.0a", "v6.0" ] )
- print( "Windows SDK Root '" + winSDKHome + "'" )
-
- env.Append( EXTRACPPPATH=[ winSDKHome + "/Include" ] )
-
# /EHsc exception handling style for visual studio
# /W3 warning level
# /WX abort build on compiler warnings