diff options
Diffstat (limited to 'lib/libUPnP/Platinum/Build/Boot.scons')
-rw-r--r-- | lib/libUPnP/Platinum/Build/Boot.scons | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/lib/libUPnP/Platinum/Build/Boot.scons b/lib/libUPnP/Platinum/Build/Boot.scons index eb49871ff2..a30fe0e79b 100644 --- a/lib/libUPnP/Platinum/Build/Boot.scons +++ b/lib/libUPnP/Platinum/Build/Boot.scons @@ -1,4 +1,5 @@ import sys +import os EnsureSConsVersion(0,98,1) @@ -15,7 +16,8 @@ PLATFORM_TO_TARGET_MAP = { 'darwin' : 'universal-apple-macosx' } -CROSS_PLATFORMS = ['ppu-sony-ps3', 'arm-unknown-linux', 'arm-gp2x-linux', 'arm-apple-darwin'] +CROSS_PLATFORMS = ['ppu-sony-ps3', 'arm-unknown-linux', 'arm-gp2x-linux', 'arm-android-linux'] +SPECIAL_PLATFORMS = ['universal-apple-macosx-xcode'] def DefaultTarget(): if PLATFORM_TO_TARGET_MAP.has_key(sys.platform): @@ -28,18 +30,48 @@ def DefaultTarget(): ####################################################### options = Variables() options.AddVariables( - EnumVariable('target', 'build target', DefaultTarget(), allowed_values=PLATFORM_TO_TARGET_MAP.values()+CROSS_PLATFORMS), - BoolVariable('stop_on_warning', 'Stop the build on warnings', True), + EnumVariable('target', 'build target', DefaultTarget(), allowed_values=PLATFORM_TO_TARGET_MAP.values()+CROSS_PLATFORMS+SPECIAL_PLATFORMS), + BoolVariable('stop_on_warning', 'Stop the build on warnings', False), ListVariable('build_config', 'build configurations', 'Debug', names=['Debug', 'Release']) ) env = Environment(variables=options) Help(options.GenerateHelpText(env)) -### call the actual build script for each build config +if 'CXX' in os.environ: + env['CXX'] = os.environ['CXX'] +if 'CC' in os.environ: + env['CC'] = os.environ['CC'] + +if not hasattr(env, 'Clone'): env.Clone = env.Copy ## old scons compatibility base_env = env -for build_config in env['build_config']: - env = base_env.Clone() - env['build_config'] = build_config - print '********** Configuring Build Target =', env['target'], '/', build_config, '********' - SConscript('Build.scons', build_dir='Targets/'+env['target']+'/'+build_config, exports='env', duplicate=0) + +### special build for x86-microsoft-win32 +if env['target'] == 'x86-microsoft-win32': + import subprocess + for build_config in env['build_config']: + env = base_env.Clone() + env['build_config'] = build_config + print '********** Configuring Build Target =', env['target'], '/', build_config, '********' + retVal = subprocess.call(["python", "Build.py", "-r", "-s", "Platinum.sln", "-b", build_config], cwd=env.GetBuildPath('#/Build/Targets/x86-microsoft-win32-vs2005/')) + if (retVal != 0): + sys.exit(retVal) + +### special build for universal-apple-macosx-xcode +elif env['target'] == 'universal-apple-macosx-xcode': + import subprocess + for build_config in env['build_config']: + env = base_env.Clone() + env['build_config'] = build_config + print '********** Configuring Build Target =', env['target'], '/', build_config, '********' + retVal = subprocess.call(["python", "../../Tools/Scripts/XCodeMake.py", "-p", "Platinum.xcodeproj", "-t", "All", "-s", "macosx", "-b", build_config], cwd=env.GetBuildPath('#/Build/Targets/universal-apple-macosx/')) + if (retVal != 0): + sys.exit(retVal) + +else: +### call the actual build script for each build config + for build_config in env['build_config']: + env = base_env.Clone() + env['build_config'] = build_config + print '********** Configuring Build Target =', env['target'], '/', build_config, '********' + SConscript('Build.scons', build_dir='Targets/'+env['target']+'/'+build_config, exports='env', duplicate=0) |