diff options
author | Steven Knight <knight@baldmt.com> | 2006-02-12 19:56:03 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-02-12 19:56:03 (GMT) |
commit | 92e52b195125e7fc89721570c0b9237105d635da (patch) | |
tree | 56208f374c81c91b572cd0fc3cf28223ef80a732 /src/engine | |
parent | 7bc5b0f51a17b8ea1e49cfe917a98610791d67aa (diff) | |
download | SCons-92e52b195125e7fc89721570c0b9237105d635da.zip SCons-92e52b195125e7fc89721570c0b9237105d635da.tar.gz SCons-92e52b195125e7fc89721570c0b9237105d635da.tar.bz2 |
Add support for Visual Studio 2005 Professional. Windows portability fixes for various tests. (Baptiste Lepilleur)
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/linkloc.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvc.py | 65 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msvs.py | 35 |
3 files changed, 71 insertions, 31 deletions
diff --git a/src/engine/SCons/Tool/linkloc.py b/src/engine/SCons/Tool/linkloc.py index 3853855..f7c2c5a 100644 --- a/src/engine/SCons/Tool/linkloc.py +++ b/src/engine/SCons/Tool/linkloc.py @@ -95,7 +95,7 @@ def generate(env): env['LIBLINKSUFFIX']='$LIBSUFFIX' msvs_version = env.get('MSVS_VERSION') - include_path, lib_path, exe_path = get_msvc_paths(msvs_version) + include_path, lib_path, exe_path = get_msvc_paths(env, version = msvs_version) env['ENV']['LIB'] = lib_path env['ENV']['PATH'] = exe_path diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index bc50eaa..8ea4b39 100644 --- a/src/engine/SCons/Tool/msvc.py +++ b/src/engine/SCons/Tool/msvc.py @@ -319,9 +319,10 @@ def _get_msvc8_path(path, version, platform, suite): def get_msvc_path(env, path, version): """ - Get a list of visualstudio directories (include, lib or path). Return - a string delimited by ';'. An exception will be raised if unable to - access the registry or appropriate registry keys not found. + Get a list of visualstudio directories (include, lib or path). + Return a string delimited by the os.pathsep separator (';'). An + exception will be raised if unable to access the registry or + appropriate registry keys not found. """ if not SCons.Util.can_read_reg: @@ -467,9 +468,9 @@ def _get_msvc8_default_paths(env, version, suite, use_mfc_dirs): MVSdir = None paths = {} - exe_path = '' - lib_path = '' - include_path = '' + exe_paths = [] + lib_paths = [] + include_paths = [] try: paths = SCons.Tool.msvs.get_msvs_install_dirs(version) MVSdir = paths['VSINSTALLDIR'] @@ -486,31 +487,44 @@ def _get_msvc8_default_paths(env, version, suite, use_mfc_dirs): else: MVSVCdir = os.path.join(MVSdir,'VC') - MVSCommondir = r'%s\Common7' % MVSdir - include_path = r'%s\include' % (MVSVCdir) - lib_path = r'%s\lib' % (MVSVCdir) - exe_path = r'%s\IDE;%s\bin;%s\Tools;%s\Tools\bin' % (MVSCommondir,MVSVCdir, MVSCommondir, MVSCommondir) + MVSCommondir = os.path.join(MVSdir, 'Common7') + include_paths.append( os.path.join(MVSVCdir, 'include') ) + lib_paths.append( os.path.join(MVSVCdir, 'lib') ) + for base, subdir in [(MVSCommondir,'IDE'), (MVSVCdir,'bin'), + (MVSCommondir,'Tools'), (MVSCommondir,r'Tools\bin')]: + exe_paths.append( os.path.join( base, subdir) ) if paths.has_key('PLATFORMSDKDIR'): PlatformSdkDir = paths['PLATFORMSDKDIR'] - include_path = include_path + r';%sInclude' % PlatformSdkDir - lib_path = lib_path + r';%s\lib' % PlatformSdkDir - if use_mfc_dirs: - include_path = include_path + r';%sInclude\mfc;%sInclude\atl' % (PlatformSdkDir, PlatformSdkDir) - lib_path = lib_path + r';%s\lib' % paths['PLATFORMSDKDIR'] - - envvar = 'include' - SCons.Util.get_environment_var(envvar) - include_path = include_path + envvar + else: + PlatformSdkDir = os.path.join(MVSVCdir,'PlatformSDK') + platform_include_path = os.path.join( PlatformSdkDir, 'Include' ) + include_paths.append( platform_include_path ) + lib_paths.append( os.path.join( PlatformSdkDir, 'Lib' ) ) + if use_mfc_dirs: + if paths.has_key('PLATFORMSDKDIR'): + include_paths.append( os.path.join( platform_include_path, 'mfc' ) ) + include_paths.append( os.path.join( platform_include_path, 'atl' ) ) + else: + atlmfc_path = os.path.join( MVSVCdir, 'atlmfc' ) + include_paths.append( os.path.join( atlmfc_path, 'include' ) ) + lib_paths.append( os.path.join( atlmfc_path, 'lib' ) ) + + env_include_path = SCons.Util.get_environment_var('INCLUDE') + if env_include_path: + include_paths.append( env_include_path ) if SCons.Util.can_read_reg and paths.has_key('FRAMEWORKSDKDIR'): - include_path = include_path + r';%s\include'%paths['FRAMEWORKSDKDIR'] - lib_path = lib_path + r';%s\lib'%paths['FRAMEWORKSDKDIR'] - exe_path = exe_path + r';%s\bin'%paths['FRAMEWORKSDKDIR'] + include_paths.append( os.path.join( paths['FRAMEWORKSDKDIR'], 'include' ) ) + lib_paths.append( os.path.join( paths['FRAMEWORKSDKDIR'], 'lib' ) ) + exe_paths.append( paths['FRAMEWORKSDKDIR'], 'bin' ) if SCons.Util.can_read_reg and paths.has_key('FRAMEWORKDIR') and paths.has_key('FRAMEWORKVERSION'): - exe_path = exe_path + r';%s\%s'%(paths['FRAMEWORKDIR'],paths['FRAMEWORKVERSION']) + exe_paths.append( os.path.join( paths['FRAMEWORKDIR'], paths['FRAMEWORKVERSION'] ) ) + include_path = string.join( include_paths, os.pathsep ) + lib_path = string.join(lib_paths, os.pathsep ) + exe_path = string.join(exe_paths, os.pathsep ) return (include_path, lib_path, exe_path) def get_msvc_paths(env, version=None, use_mfc_dirs=0): @@ -722,6 +736,11 @@ def generate(env): env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' env['BUILDERS']['PCH'] = pch_builder + if not env.has_key('ENV'): + env['ENV'] = {} + if not env['ENV'].has_key('SystemRoot'): # required for dlls in the winsxs folders + env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() + def exists(env): if SCons.Tool.msvs.is_msvs_installed(): # there's at least one version of MSVS installed. diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 074733a..f00aca9 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -1135,7 +1135,9 @@ def get_default_visualstudio_version(env): if not env.has_key('MSVS') or not SCons.Util.is_Dict(env['MSVS']): env['MSVS'] = {} - if SCons.Util.can_read_reg: + if env['MSVS'].has_key('VERSIONS'): + versions = env['MSVS']['VERSIONS'] + elif SCons.Util.can_read_reg: v = get_visualstudio_versions() if v: versions = v @@ -1275,11 +1277,28 @@ def get_visualstudio8_suites(): suites = [] - # ToDo: add tests for better suits than VS8 Express here. + # Detect Standard, Professional and Team edition + try: + idk = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, + r'Software\Microsoft\VisualStudio\8.0') + id = SCons.Util.RegQueryValueEx(idk, 'InstallDir') + editions = { 'PRO': r'Setup\VS\Pro' } # ToDo: add standard and team editions + edition_name = 'STD' + for name, key_suffix in editions.items(): + try: + idk = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, + r'Software\Microsoft\VisualStudio\8.0' + '\\' + key_suffix ) + edition_name = name + except SCons.Util.RegError: + pass + suites.append(edition_name) + except SCons.Util.RegError: + pass - idk = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, - r'Software\Microsoft\VCExpress\8.0') + # Detect Expression edition try: + idk = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, + r'Software\Microsoft\VCExpress\8.0') id = SCons.Util.RegQueryValueEx(idk, 'InstallDir') suites.append('EXPRESS') except SCons.Util.RegError: @@ -1315,10 +1334,12 @@ def get_msvs_install_dirs(version = None): version_num, suite = msvs_parse_version(version) + K = 'Software\\Microsoft\\VisualStudio\\' + str(version_num) if (version_num >= 8.0): - K = 'Software\\Microsoft\\VCExpress\\' + str(version_num) - else: - K = 'Software\\Microsoft\\VisualStudio\\' + str(version_num) + try: + SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, K ) + except SCons.Util.RegError: + K = 'Software\\Microsoft\\VCExpress\\' + str(version_num) # vc++ install dir rv = {} |