From 41b729ccff74e5a9154bee7db0d36ffd74641eae Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 10:18:13 +0530 Subject: Removing etc1 from build for javascript platform. Based on inputs from reduz 1) Made etc1 optional driver and default yes. 2) Reverted the hack in rg_etc1.cpp 3) Disabled etc1 for javascript plaform. --- SConstruct | 1 + 1 file changed, 1 insertion(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 2dc9fa1e7..50acd3884 100644 --- a/SConstruct +++ b/SConstruct @@ -111,6 +111,7 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') +opts.Add('etc1','etc1 Texture compression 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') -- cgit v1.3.1 From d3280f91a13da6c106f95c289c095714c638d201 Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 11:06:28 +0530 Subject: Missed some things in prev commit. --- SConstruct | 2 ++ drivers/etc1/SCsub | 3 ++- drivers/register_driver_types.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 50acd3884..42c803e81 100644 --- a/SConstruct +++ b/SConstruct @@ -308,6 +308,8 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) + if (env['etc1']=='yes'): + env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 152dc3f4d..251c3ffb8 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,7 +6,8 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -env.drivers_sources+=etc_sources +if (env["etc1"] != "no"): + env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e4bb1a343..e730171fb 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,7 +222,10 @@ void register_driver_types() { #endif #endif +#ifdef ETC1_ENABLED _register_etc1_compress_func(); +#endif + initialize_chibi(); } -- cgit v1.3.1 From 9965e93f7eb7297490de597cc8ed8e18b4ba2872 Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 11:12:13 +0530 Subject: Revert "Removing etc1 from build for javascript platform." This reverts commit 41b729ccff74e5a9154bee7db0d36ffd74641eae. --- SConstruct | 1 - drivers/etc1/rg_etc1.cpp | 4 ++++ platform/javascript/detect.py | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 42c803e81..cb32c0b5f 100644 --- a/SConstruct +++ b/SConstruct @@ -111,7 +111,6 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') -opts.Add('etc1','etc1 Texture compression 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') diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index d2959da38..7eb1427d7 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1918,7 +1918,11 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); + #ifdef JAVASCRIPT_ENABLED + if (err < best_error || best_error == cUINT32_MAX) + #else if (err < best_error) + #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 947a637fb..3123367ff 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -36,7 +36,6 @@ def get_flags(): ('squish', 'no'), ('speex', 'no'), ('old_scenes', 'no'), - ('etc1', 'no'), # ('default_gui_theme', 'no'), #('builtin_zlib', 'no'), -- cgit v1.3.1 From 2e59788aa9be6dab49e06588fcb1cf812e55a0cf Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 11:12:59 +0530 Subject: Revert "Missed some things in prev commit." This reverts commit d3280f91a13da6c106f95c289c095714c638d201. --- SConstruct | 2 -- drivers/etc1/SCsub | 3 +-- drivers/register_driver_types.cpp | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index cb32c0b5f..2dc9fa1e7 100644 --- a/SConstruct +++ b/SConstruct @@ -307,8 +307,6 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) - if (env['etc1']=='yes'): - env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 251c3ffb8..152dc3f4d 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,8 +6,7 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -if (env["etc1"] != "no"): - env.drivers_sources+=etc_sources +env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e730171fb..e4bb1a343 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,10 +222,7 @@ void register_driver_types() { #endif #endif -#ifdef ETC1_ENABLED _register_etc1_compress_func(); -#endif - initialize_chibi(); } -- cgit v1.3.1 From eb3c88b3ddbe27826f634912b048589dff435847 Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 11:47:56 +0530 Subject: Revert "Revert "Removing etc1 from build for javascript platform."" This reverts commit 9965e93f7eb7297490de597cc8ed8e18b4ba2872. --- SConstruct | 1 + drivers/etc1/rg_etc1.cpp | 4 ---- platform/javascript/detect.py | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 2dc9fa1e7..50acd3884 100644 --- a/SConstruct +++ b/SConstruct @@ -111,6 +111,7 @@ opts.Add('jpg','JPG Image loader support (yes/no)','yes') opts.Add('webp','WEBP Image loader support (yes/no)','yes') opts.Add('dds','DDS Texture loader support (yes/no)','yes') opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') +opts.Add('etc1','etc1 Texture compression 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') diff --git a/drivers/etc1/rg_etc1.cpp b/drivers/etc1/rg_etc1.cpp index 7eb1427d7..d2959da38 100644 --- a/drivers/etc1/rg_etc1.cpp +++ b/drivers/etc1/rg_etc1.cpp @@ -1918,11 +1918,7 @@ done: int v = etc1_decode_value(diff, inten, selector, packed_c); uint err = labs(v - static_cast(color)); //printf("err: %d - %u = %u\n",v,color,err); - #ifdef JAVASCRIPT_ENABLED - if (err < best_error || best_error == cUINT32_MAX) - #else if (err < best_error) - #endif { best_error = err; best_packed_c = packed_c; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 3123367ff..947a637fb 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -36,6 +36,7 @@ def get_flags(): ('squish', 'no'), ('speex', 'no'), ('old_scenes', 'no'), + ('etc1', 'no'), # ('default_gui_theme', 'no'), #('builtin_zlib', 'no'), -- cgit v1.3.1 From beab10ab9b18c8081ad85d2a59ce23e943f835b0 Mon Sep 17 00:00:00 2001 From: V.VamsiKrishna Date: Fri, 20 Mar 2015 11:48:21 +0530 Subject: Revert "Revert "Missed some things in prev commit."" This reverts commit 2e59788aa9be6dab49e06588fcb1cf812e55a0cf. --- SConstruct | 2 ++ drivers/etc1/SCsub | 3 ++- drivers/register_driver_types.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 50acd3884..42c803e81 100644 --- a/SConstruct +++ b/SConstruct @@ -308,6 +308,8 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) + if (env['etc1']=='yes'): + env.Append(CPPFLAGS=['-DETC1_ENABLED']) Export('env') diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 152dc3f4d..251c3ffb8 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -6,7 +6,8 @@ etc_sources = [ "etc1/rg_etc1.cpp" ] -env.drivers_sources+=etc_sources +if (env["etc1"] != "no"): + env.drivers_sources+=etc_sources #env.add_source_files(env.drivers_sources, etc_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e4bb1a343..e730171fb 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -222,7 +222,10 @@ void register_driver_types() { #endif #endif +#ifdef ETC1_ENABLED _register_etc1_compress_func(); +#endif + initialize_chibi(); } -- cgit v1.3.1 From 7ea3482c38a1d18af687aa6a08d7dea9f346a2e9 Mon Sep 17 00:00:00 2001 From: yg2f Date: Wed, 1 Apr 2015 17:04:41 +0200 Subject: add scons extra suffix option makes it possible to add a custom extra suffix to the base filename of all generated binary files. example : scons p=windows extra_suffix=yourBranchName or scons p=windows bits=32 extra_suffix=v20150401_1642 or scons p=windows extra_suffix=msvc2010_git20150401 --- SConstruct | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 2dc9fa1e7..922dc64fe 100644 --- a/SConstruct +++ b/SConstruct @@ -121,6 +121,7 @@ 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('colored', 'Enable colored output for the compilation (yes/no)', 'no') +opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '') # add platform specific options @@ -176,6 +177,9 @@ if selected_platform in platform_list: env = env_base.Clone() env.extra_suffix="" + + if env["extra_suffix"] != '' : + env.extra_suffix += '.'+env["extra_suffix"] CCFLAGS = env.get('CCFLAGS', '') env['CCFLAGS'] = '' -- cgit v1.3.1 From 2a4da03f103448a69c48ee66e415f8dd2d617f58 Mon Sep 17 00:00:00 2001 From: Antony Jones Date: Sun, 3 May 2015 15:18:56 -0600 Subject: Added Visual Studio project generation. Use "vsproj=yes" in command line. This does not set up NMAKE properly. --- SConstruct | 46 ++++++++++++ drivers/SCsub | 185 +++++++++++++++++++++++++------------------------ platform/windows/SCsub | 6 ++ 3 files changed, 146 insertions(+), 91 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 537bb0e39..11b35e0b4 100644 --- a/SConstruct +++ b/SConstruct @@ -123,6 +123,7 @@ 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('colored', 'Enable colored output for the compilation (yes/no)', 'no') opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '') +opts.Add('vsproj', 'Generate Visual Studio Project. (yes/no)', 'no') # add platform specific options @@ -177,6 +178,25 @@ if selected_platform in platform_list: else: env = env_base.Clone() + if env['vsproj']=="yes": + env.vs_incs = [] + env.vs_srcs = [] + + def AddToVSProject( sources ): + for x in sources: + if type(x) == type(""): + fname = env.File(x).path + else: + fname = env.File(x)[0].path + pieces = fname.split(".") + if len(pieces)>0: + 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.extra_suffix="" if env["extra_suffix"] != '' : @@ -330,6 +350,32 @@ 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": + + AddToVSProject(env.core_sources) + AddToVSProject(env.main_sources) + AddToVSProject(env.modules_sources) + AddToVSProject(env.scene_sources) + AddToVSProject(env.servers_sources) + AddToVSProject(env.tool_sources) + + debug_variants = ['Debug|Win32']+['Debug|x64'] + release_variants = ['Release|Win32']+['Release|x64'] + release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64'] + variants = debug_variants + release_variants + release_debug_variants + debug_targets = ['Debug']+['Debug'] + release_targets = ['Release']+['Release'] + release_debug_targets = ['ReleaseDebug']+['ReleaseDebug'] + 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) else: diff --git a/drivers/SCsub b/drivers/SCsub index a1a2191cb..6ab097362 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -1,91 +1,94 @@ -Import('env') - -env.drivers_sources=[] -#env.add_source_files(env.drivers_sources,"*.cpp") -env.Append(CPPPATH=["vorbis"]) -Export('env') - -SConscript('unix/SCsub'); -SConscript('alsa/SCsub'); -SConscript('pulseaudio/SCsub'); -SConscript('windows/SCsub'); -SConscript('gles2/SCsub'); -SConscript('gl_context/SCsub'); -SConscript('openssl/SCsub'); - -if (env["png"]=="yes"): - SConscript("png/SCsub"); -if (env["jpg"]=="yes"): - SConscript("jpg/SCsub"); -if (env["webp"]=="yes"): - SConscript("webp/SCsub"); -SConscript("dds/SCsub"); -SConscript("pvr/SCsub"); -SConscript("etc1/SCsub") -if (env["builtin_zlib"]=="yes"): - SConscript("builtin_zlib/SCsub"); -if (env["openssl"]=="builtin"): - SConscript("builtin_openssl2/SCsub"); - -SConscript("rtaudio/SCsub"); -SConscript("nedmalloc/SCsub"); -SConscript("trex/SCsub"); -SConscript("chibi/SCsub"); -if (env["vorbis"]=="yes" or env["speex"]=="yes" or env["theora"]=="yes"): - SConscript("ogg/SCsub"); -if (env["vorbis"]=="yes"): - SConscript("vorbis/SCsub"); -if (env["tools"]=="yes"): - SConscript("convex_decomp/SCsub"); - -if env["theora"]=="yes": - SConscript("theoraplayer/SCsub") -if (env["theora"]=="yes"): - SConscript("theora/SCsub"); -if (env['speex']=='yes'): - SConscript("speex/SCsub"); -if (env['musepack']=='yes'): - SConscript("mpc/SCsub"); -if (env["squish"]=="yes" and env["tools"]=="yes"): - SConscript("squish/SCsub"); - -num = 0 -cur_base = "" -total = len(env.drivers_sources) -max_src = 64 -list = [] -lib_list = [] - -import string - -for f in env.drivers_sources: - fname = "" - if type(f) == type(""): - fname = env.File(f).path - else: - fname = env.File(f)[0].path - #base = string.join(fname.split("/")[:-1], "/") - fname = fname.replace("\\", "/") - base = string.join(fname.split("/")[:2], "/") - if base != cur_base and len(list) > max_src: - lib = env.Library("drivers"+str(num), list) - lib_list.append(lib) - list = [] - num = num+1 - cur_base = base - list.append(f) - -if len(list) > 0: - lib = env.Library("drivers"+str(num), list) - lib_list.append(lib) - - -drivers_base=[] -env.add_source_files(drivers_base,"*.cpp") -lib_list.insert(0, env.Library("drivers", drivers_base)) - -env.Prepend(LIBS=lib_list) - -#lib = env.Library("drivers",env.drivers_sources) -#env.Prepend(LIBS=[lib]) - +Import('env') + +env.drivers_sources=[] +#env.add_source_files(env.drivers_sources,"*.cpp") +env.Append(CPPPATH=["vorbis"]) +Export('env') + +SConscript('unix/SCsub'); +SConscript('alsa/SCsub'); +SConscript('pulseaudio/SCsub'); +SConscript('windows/SCsub'); +SConscript('gles2/SCsub'); +SConscript('gl_context/SCsub'); +SConscript('openssl/SCsub'); + +if (env["png"]=="yes"): + SConscript("png/SCsub"); +if (env["jpg"]=="yes"): + SConscript("jpg/SCsub"); +if (env["webp"]=="yes"): + SConscript("webp/SCsub"); +SConscript("dds/SCsub"); +SConscript("pvr/SCsub"); +SConscript("etc1/SCsub") +if (env["builtin_zlib"]=="yes"): + SConscript("builtin_zlib/SCsub"); +if (env["openssl"]=="builtin"): + SConscript("builtin_openssl2/SCsub"); + +SConscript("rtaudio/SCsub"); +SConscript("nedmalloc/SCsub"); +SConscript("trex/SCsub"); +SConscript("chibi/SCsub"); +if (env["vorbis"]=="yes" or env["speex"]=="yes" or env["theora"]=="yes"): + SConscript("ogg/SCsub"); +if (env["vorbis"]=="yes"): + SConscript("vorbis/SCsub"); +if (env["tools"]=="yes"): + SConscript("convex_decomp/SCsub"); + +if env["theora"]=="yes": + SConscript("theoraplayer/SCsub") +if (env["theora"]=="yes"): + SConscript("theora/SCsub"); +if (env['speex']=='yes'): + SConscript("speex/SCsub"); +if (env['musepack']=='yes'): + SConscript("mpc/SCsub"); +if (env["squish"]=="yes" and env["tools"]=="yes"): + SConscript("squish/SCsub"); + +num = 0 +cur_base = "" +total = len(env.drivers_sources) +max_src = 64 +list = [] +lib_list = [] + +import string + +if env['vsproj']=="yes": + env.AddToVSProject(env.drivers_sources) + +for f in env.drivers_sources: + fname = "" + if type(f) == type(""): + fname = env.File(f).path + else: + fname = env.File(f)[0].path + #base = string.join(fname.split("/")[:-1], "/") + fname = fname.replace("\\", "/") + base = string.join(fname.split("/")[:2], "/") + if base != cur_base and len(list) > max_src: + lib = env.Library("drivers"+str(num), list) + lib_list.append(lib) + list = [] + num = num+1 + cur_base = base + list.append(f) + +if len(list) > 0: + lib = env.Library("drivers"+str(num), list) + lib_list.append(lib) + + +drivers_base=[] +env.add_source_files(drivers_base,"*.cpp") +lib_list.insert(0, env.Library("drivers", drivers_base)) + +env.Prepend(LIBS=lib_list) + +#lib = env.Library("drivers",env.drivers_sources) +#env.Prepend(LIBS=[lib]) + diff --git a/platform/windows/SCsub b/platform/windows/SCsub index a77428e95..1ad32e798 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -12,3 +12,9 @@ common_win=[ ] env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) + +# Microsoft Visual Studio Project Generation +if (env['vsproj'])=="yes": + env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] + for x in common_win: + env.vs_srcs = env.vs_srcs + ["platform/windows/" + x] -- cgit v1.3.1 From 6edbab0a9fed4a3ea9988b4054c42ce96a43d143 Mon Sep 17 00:00:00 2001 From: Peace Sells Date: Sun, 24 May 2015 01:04:26 -0600 Subject: Setting build vs properties in scons. --- SConstruct | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 11b35e0b4..a1a323830 100644 --- a/SConstruct +++ b/SConstruct @@ -360,6 +360,11 @@ if selected_platform in platform_list: 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" + env['MSVSCLEANCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes" debug_variants = ['Debug|Win32']+['Debug|x64'] release_variants = ['Release|Win32']+['Release|x64'] -- cgit v1.3.1