summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-10-07 01:31:49 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-10-07 01:31:49 -0300
commit0fa94a96904a8ff44d1a26fd6b783c2d6a533540 (patch)
tree80cc315b3578a1e1ffc7d73f18768db269dbafb3 /SConstruct
parenta0ae38e0c14f94911df6a651c90ff0df03821bbc (diff)
Build System Changes
-=-=-=-=-=-=-=-=-=-= Build System: -Big clean up of SCons, changed how builds are done to a much cleaner method (check the Github Wiki for instructions). -Deactivated BlackBerry10 (sorry), if no mantainer found (or BlackBerry does not send us a Passort ;), platform will be removed as we have no longer devices to test. Engine: -Removed deprecated object and scene format (was in there just for compatibility, not in use since a long time). -Added ability to open scenes even if a node type was removed (will try to guess the closest type). -Removed deprecated node types.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct140
1 files changed, 67 insertions, 73 deletions
diff --git a/SConstruct b/SConstruct
index de7256f6bc..7589ab3e6c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -8,15 +8,6 @@ import sys
import methods
import multiprocessing
-# Enable aggresive compile mode if building on a multi core box
-# only is we have not set the number of jobs already or we do
-# not want it
-if ARGUMENTS.get('spawn_jobs', 'no') == 'yes' and \
- int(GetOption('num_jobs')) <= 1:
- NUM_JOBS = multiprocessing.cpu_count()
- if NUM_JOBS > 1:
- SetOption('num_jobs', NUM_JOBS+1)
-
methods.update_version()
# scan possible build platforms
@@ -58,8 +49,7 @@ for x in glob.glob("platform/*"):
module_list=methods.detect_modules()
-print "Detected Platforms: "+str(platform_list)
-print("Detected Modules: "+str(module_list))
+#print "Detected Platforms: "+str(platform_list)
methods.save_active_platforms(active_platforms,active_platform_ids)
@@ -99,19 +89,15 @@ if profile:
customs.append(profile+".py")
opts=Variables(customs, ARGUMENTS)
-opts.Add('target', 'Compile Target (debug/profile/release).', "debug")
-opts.Add('platform','Platform: '+str(platform_list)+'(sfml).',"")
-opts.Add('python','Build Python Support: (yes/no)','no')
-opts.Add('squirrel','Build Squirrel Support: (yes/no)','no')
+opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug")
+opts.Add('bits', 'Compile Target Bits (default/32/64).', "default")
+opts.Add('platform','Platform: '+str(platform_list)+'.',"")
+opts.Add('p','Platform (same as platform=).',"")
opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes')
-opts.Add('lua','Build Lua Support: (yes/no)','no')
-opts.Add('rfd','Remote Filesystem Driver: (yes/no)','no')
opts.Add('gdscript','Build GDSCript support: (yes/no)','yes')
opts.Add('vorbis','Build Ogg Vorbis Support: (yes/no)','yes')
opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
-opts.Add('opengl', 'Build OpenGL Support: (yes/no)', 'yes')
-opts.Add('game', 'Game (custom) Code Directory', "")
-opts.Add('squish','Squish BC Texture Compression (yes/no)','yes')
+opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
opts.Add('theora','Theora Video (yes/no)','yes')
opts.Add('freetype','Freetype support in editor','yes')
opts.Add('speex','Speex Audio (yes/no)','yes')
@@ -124,15 +110,12 @@ opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes')
opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes')
opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
opts.Add('musepack','Musepack Audio (yes/no)','yes')
-opts.Add('default_gui_theme','Default GUI theme (yes/no)','yes')
opts.Add("CXX", "Compiler");
-opts.Add("nedmalloc", "Add nedmalloc support", 'yes');
opts.Add("CCFLAGS", "Custom flags for the C++ compiler");
opts.Add("CFLAGS", "Custom flags for the C compiler");
opts.Add("LINKFLAGS", "Custom flags for the linker");
opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no")
opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no")
-opts.Add('old_scenes', 'Compatibility with old-style scenes', "yes")
# add platform specific options
@@ -152,7 +135,6 @@ Help(opts.GenerateHelpText(env_base)) # generate help
env_base.Append(CPPPATH=['#core','#core/math','#tools','#drivers','#'])
# configure ENV for platform
-env_base.detect_python=True
env_base.platform_exporters=platform_exporters
"""
@@ -170,17 +152,26 @@ if (env_base['target']=='debug'):
env_base.platforms = {}
-for p in platform_list:
+selected_platform =""
- if env_base['platform'] != "" and env_base['platform'] != p:
- continue
- sys.path.append("./platform/"+p)
+if env_base['platform'] != "":
+ selected_platform=env_base['platform']
+elif env_base['p'] != "":
+ selected_platform=env_base['p']
+ env_base["platform"]=selected_platform
+
+
+if selected_platform in platform_list:
+
+ sys.path.append("./platform/"+selected_platform)
import detect
if "create" in dir(detect):
env = detect.create(env_base)
else:
env = env_base.Clone()
+ env.extra_suffix=""
+
CCFLAGS = env.get('CCFLAGS', '')
env['CCFLAGS'] = ''
@@ -197,17 +188,49 @@ for p in platform_list:
env.Append(LINKFLAGS=string.split(str(LINKFLAGS)))
detect.configure(env)
- env['platform'] = p
- if not env.has_key('platform_libsuffix'):
- env['platform_libsuffix'] = env['LIBSUFFIX']
- sys.path.remove("./platform/"+p)
- sys.modules.pop('detect')
- flag_list = platform_flags[p]
+
+ flag_list = platform_flags[selected_platform]
for f in flag_list:
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
env[f[0]] = f[1]
- print(f[0]+":"+f[1])
+
+ #env['platform_libsuffix'] = env['LIBSUFFIX']
+
+ suffix="."+selected_platform
+
+ if (env["target"]=="release"):
+ if (env["tools"]=="yes"):
+ print("Tools can only be built with targets 'debug' and 'release_debug'.")
+ sys.exit(255)
+ suffix+=".opt"
+
+ elif (env["target"]=="release_debug"):
+ if (env["tools"]=="yes"):
+ suffix+=".opt.tools"
+ else:
+ suffix+=".opt.debug"
+ else:
+ if (env["tools"]=="yes"):
+ suffix+=".tools"
+ else:
+ suffix+=".debug"
+
+ if (env["bits"]=="32"):
+ suffix+=".32"
+ elif (env["bits"]=="64"):
+ suffix+=".64"
+
+ suffix+=env.extra_suffix
+
+ env["PROGSUFFIX"]=suffix+env["PROGSUFFIX"]
+ env["OBJSUFFIX"]=suffix+env["OBJSUFFIX"]
+ env["LIBSUFFIX"]=suffix+env["LIBSUFFIX"]
+ env["SHLIBSUFFIX"]=suffix+env["SHLIBSUFFIX"]
+
+ sys.path.remove("./platform/"+selected_platform)
+ sys.modules.pop('detect')
+
env.module_list=[]
@@ -218,7 +241,7 @@ for p in platform_list:
sys.path.append(tmppath)
env.current_module=x
import config
- if (config.can_build(p)):
+ if (config.can_build(selected_platform)):
config.configure(env)
env.module_list.append(x)
sys.path.remove(tmppath)
@@ -232,11 +255,6 @@ for p in platform_list:
if (env['openssl']=="builtin"):
env.Append(CPPPATH=['#drivers/builtin_openssl2'])
-
- if (env["old_scenes"]=='yes'):
- env.Append(CPPFLAGS=['-DOLD_SCENE_FORMAT_ENABLED'])
- if (env["rfd"]=='yes'):
- env.Append(CPPFLAGS=['-DRFD_ENABLED'])
if (env["builtin_zlib"]=='yes'):
env.Append(CPPPATH=['#drivers/builtin_zlib/zlib'])
@@ -281,34 +299,6 @@ for p in platform_list:
if (env['xml']=='yes'):
env.Append(CPPFLAGS=['-DXML_ENABLED'])
- if (env['default_gui_theme']=='no'):
- env.Append(CPPFLAGS=['-DDEFAULT_THEME_DISABLED'])
-
- if (env["python"]=='yes'):
- detected=False;
- if (env.detect_python):
- print("Python 3.0 Prefix:");
- pycfg_exec="python3-config"
- errorval=os.system(pycfg_exec+" --prefix")
- prefix=""
- if (not errorval):
- #gah, why can't it get both at the same time like pkg-config, sdl-config, etc?
- env.ParseConfig(pycfg_exec+" --cflags")
- env.ParseConfig(pycfg_exec+" --libs")
- detected=True
-
- if (detected):
- env.Append(CPPFLAGS=['-DPYTHON_ENABLED'])
- #remove annoying warnings
- if ('-Wstrict-prototypes' in env["CCFLAGS"]):
- env["CCFLAGS"].remove('-Wstrict-prototypes');
- if ('-fwrapv' in env["CCFLAGS"]):
- env["CCFLAGS"].remove('-fwrapv');
- else:
- print("Python 3.0 not detected ("+pycfg_exec+") support disabled.");
-
- #if env['nedmalloc'] == 'yes':
- # env.Append(CPPFLAGS = ['-DNEDMALLOC_ENABLED'])
Export('env')
@@ -321,11 +311,15 @@ for p in platform_list:
SConscript("drivers/SCsub")
SConscript("bin/SCsub")
- if env['game']:
- SConscript(env['game']+'/SCsub')
-
SConscript("modules/SCsub")
SConscript("main/SCsub")
- SConscript("platform/"+p+"/SCsub"); # build selected platform
+ SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform
+
+else:
+ print("No valid target platform selected.")
+ print("The following were detected:")
+ for x in platform_list:
+ print("\t"+x)
+ print("\nPlease run scons again with argument: platform=<string>")