diff options
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/SConstruct b/SConstruct index 11b35e0b4b..05c53a15fc 100644 --- a/SConstruct +++ b/SConstruct @@ -54,13 +54,16 @@ methods.save_active_platforms(active_platforms,active_platform_ids) custom_tools=['default'] +platform_arg = ARGUMENTS.get("platform", False) + if (os.name=="posix"): pass elif (os.name=="nt"): - if (os.getenv("VSINSTALLDIR")==None): - custom_tools=['mingw'] + if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"): + custom_tools=['mingw'] env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']}); + #env_base=Environment(tools=custom_tools); env_base.global_defaults=global_defaults env_base.android_source_modules=[] @@ -99,6 +102,7 @@ opts.Add('p','Platform (same as platform=).',"") opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes') opts.Add('gdscript','Build GDSCript support: (yes/no)','yes') opts.Add('vorbis','Build Ogg Vorbis Support: (yes/no)','yes') +opts.Add('opus','Build Opus Audio Format Support: (yes/no)','yes') opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes') opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes') opts.Add('theora','Theora Video (yes/no)','yes') @@ -181,7 +185,7 @@ if selected_platform in platform_list: if env['vsproj']=="yes": env.vs_incs = [] env.vs_srcs = [] - + def AddToVSProject( sources ): for x in sources: if type(x) == type(""): @@ -193,12 +197,12 @@ if selected_platform in platform_list: basename = pieces[0] basename = basename.replace('\\\\','/') env.vs_srcs = env.vs_srcs + [basename + ".cpp"] - env.vs_incs = env.vs_incs + [basename + ".h"] - #print basename - env.AddToVSProject = AddToVSProject - + env.vs_incs = env.vs_incs + [basename + ".h"] + #print basename + env.AddToVSProject = AddToVSProject + env.extra_suffix="" - + if env["extra_suffix"] != '' : env.extra_suffix += '.'+env["extra_suffix"] @@ -217,15 +221,15 @@ if selected_platform in platform_list: env.Append(LINKFLAGS=string.split(str(LINKFLAGS))) - detect.configure(env) - - 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] - #env['platform_libsuffix'] = env['LIBSUFFIX'] + #must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) + detect.configure(env) + + #env['platform_libsuffix'] = env['LIBSUFFIX'] suffix="."+selected_platform @@ -280,10 +284,11 @@ if selected_platform in platform_list: if (env['musepack']=='yes'): env.Append(CPPFLAGS=['-DMUSEPACK_ENABLED']); - if (env['openssl']!='no'): - env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); - if (env['openssl']=="builtin"): - env.Append(CPPPATH=['#drivers/builtin_openssl2']) + + if (env['openssl']!='no'): + env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); + if (env['openssl']=="builtin"): + env.Append(CPPPATH=['#drivers/builtin_openssl2']) if (env["builtin_zlib"]=='yes'): env.Append(CPPPATH=['#drivers/builtin_zlib/zlib']) @@ -296,6 +301,8 @@ if selected_platform in platform_list: if (env['vorbis']=='yes'): env.Append(CPPFLAGS=['-DVORBIS_ENABLED']); + if (env['opus']=='yes'): + env.Append(CPPFLAGS=['-DOPUS_ENABLED']); if (env['theora']=='yes'): env.Append(CPPFLAGS=['-DTHEORA_ENABLED']); @@ -331,7 +338,7 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) - + if (env['etc1']=='yes'): env.Append(CPPFLAGS=['-DETC1_ENABLED']) @@ -350,17 +357,22 @@ if selected_platform in platform_list: SConscript("main/SCsub") SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform - - # Microsoft Visual Studio Project Generation - if (env['vsproj'])=="yes": - + + # Microsoft Visual Studio Project Generation + if (env['vsproj'])=="yes": + AddToVSProject(env.core_sources) AddToVSProject(env.main_sources) - AddToVSProject(env.modules_sources) + AddToVSProject(env.modules_sources) AddToVSProject(env.scene_sources) AddToVSProject(env.servers_sources) AddToVSProject(env.tool_sources) - + + #env['MSVS_VERSION']='9.0' + env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes" + env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes vsproj=true" + env['MSVSCLEANCOM'] = "scons --clean platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes" + debug_variants = ['Debug|Win32']+['Debug|x64'] release_variants = ['Release|Win32']+['Release|x64'] release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64'] @@ -371,11 +383,11 @@ if selected_platform in platform_list: targets = debug_targets + release_targets + release_debug_targets msvproj = env.MSVSProject(target = ['#godot' + env['MSVSPROJECTSUFFIX'] ], incs = env.vs_incs, - srcs = env.vs_srcs, - runfile = targets, - buildtarget = targets, - auto_build_solution=1, - variant = variants) + srcs = env.vs_srcs, + runfile = targets, + buildtarget = targets, + auto_build_solution=1, + variant = variants) else: |