From e1b26455e7145e5751310082d9d3dde129b23a38 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Sat, 13 Mar 2010 10:59:50 +0000 Subject: [PATCH] - added support for compilation using Microsoft Visual Studio 2008 --- README.txt | 7 ++++++- SConstruct | 14 +++++++++++++- makerelease.py | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index ed7ef8f..424e42d 100644 --- a/README.txt +++ b/README.txt @@ -35,9 +35,14 @@ where PLTFRM may be one of: msvc70 Microsoft Visual Studio 2002 msvc71 Microsoft Visual Studio 2003 msvc80 Microsoft Visual Studio 2005 + msvc90 Microsoft Visual Studio 2008 linux-gcc Gnu C++ (linux, also reported to work for Mac OS X) + +Notes: if you are building with Microsoft Visual Studio 2008, you need to +setup the environment by running vcvars32.bat (e.g. MSVC 2008 command prompt) +before running scons. -adding platform is fairly simple. You need to change the Sconstruct file +Adding platform is fairly simple. You need to change the Sconstruct file to do so. and TARGET may be: diff --git a/SConstruct b/SConstruct index d652887..23225cb 100644 --- a/SConstruct +++ b/SConstruct @@ -18,7 +18,7 @@ options = Variables() options.Add( EnumVariable('platform', 'Platform (compiler/stl) used to build the project', 'msvc71', - allowed_values='suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 linux-gcc'.split(), + allowed_values='suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 msvc90 linux-gcc'.split(), ignorecase=2) ) try: @@ -102,6 +102,18 @@ elif platform == 'msvc80': for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: env.Tool( tool ) env['CXXFLAGS']='-GR -EHsc /nologo /MT' +elif platform == 'msvc90': + env['MSVS_VERSION']='9.0' + # Scons 1.2 fails to detect the correct location of the platform SDK. + # So we propagate those from the environment. This requires that the + # user run vcvars32.bat before compiling. + if 'INCLUDE' in os.environ: + env['ENV']['INCLUDE'] = os.environ['INCLUDE'] + if 'LIB' in os.environ: + env['ENV']['LIB'] = os.environ['LIB'] + for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: + env.Tool( tool ) + env['CXXFLAGS']='-GR -EHsc /nologo /MT' elif platform == 'mingw': env.Tool( 'mingw' ) env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] ) diff --git a/makerelease.py b/makerelease.py index 8131cf4..9b59180 100644 --- a/makerelease.py +++ b/makerelease.py @@ -3,7 +3,7 @@ Requires Python 2.6 Example of invocation (use to test the script): -python makerelease.py --platform=msvc6,msvc71,msvc80,mingw -ublep 0.6.0 0.7.0-dev +python makerelease.py --platform=msvc6,msvc71,msvc80,msvc90,mingw -ublep 0.6.0 0.7.0-dev When testing this script: python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,mingw -ublep test-0.5.0 test-0.6.0-dev