diff --git a/SConstruct b/SConstruct index 0d8a84b6e81..04c648c2837 100644 --- a/SConstruct +++ b/SConstruct @@ -104,6 +104,8 @@ env_base.__class__.split_lib = methods.split_lib env_base["x86_libtheora_opt_gcc"] = False env_base["x86_libtheora_opt_vc"] = False +# Build options + customs = ['custom.py'] profile = ARGUMENTS.get("profile", False) @@ -115,41 +117,53 @@ if profile: customs.append(profile + ".py") opts = Variables(customs, ARGUMENTS) -opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug") -opts.Add('arch', 'Platform dependent architecture (arm/arm64/x86/x64/mips/etc)', "") -opts.Add('bits', 'Compile Target Bits (default/32/64/fat).', "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('gdscript', 'Build GDSCript support: (yes/no)', 'yes') -opts.Add('libogg', 'Ogg library for ogg container support (system/builtin)', 'builtin') -opts.Add('libvorbis', 'Ogg Vorbis library for vorbis support (system/builtin)', 'builtin') -opts.Add('libtheora', 'Theora library for theora module (system/builtin)', 'builtin') -opts.Add('libvpx', 'VPX library for webm module (system/builtin)', 'builtin') -opts.Add('opus', 'Opus and opusfile library for Opus format support: (system/builtin)', 'builtin') -opts.Add('minizip', 'Build Minizip Archive Support: (yes/no)', 'yes') -opts.Add('squish', 'Squish library for BC Texture Compression in editor (system/builtin)', 'builtin') -opts.Add('freetype', 'Freetype library for TTF support via freetype module (system/builtin)', 'builtin') -opts.Add('xml', 'XML Save/Load support (yes/no)', 'yes') -opts.Add('libpng', 'libpng library for image loader support (system/builtin)', 'builtin') -opts.Add('libwebp', 'libwebp library for webp module (system/builtin)', 'builtin') -opts.Add('openssl', 'OpenSSL library for openssl module (system/builtin)', 'builtin') -opts.Add('libmpcdec', 'libmpcdec library for mpc module (system/builtin)', 'builtin') -opts.Add('enet', 'ENet library (system/builtin)', 'builtin') -opts.Add('glew', 'GLEW library for the gl_context (system/builtin)', 'builtin') -opts.Add('xaudio2', 'XAudio2 audio driver (yes/no)', 'no') -opts.Add("CXX", "C++ Compiler") -opts.Add("CC", "C Compiler") -opts.Add("CCFLAGS", "Custom flags for the C/C++ compiler") + +# Target build options +opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/etc)", '') +opts.Add('bits', "Target platform bits (default/32/64/fat)", 'default') +opts.Add('p', "Platform (alias for 'platform')", '') +opts.Add('platform', "Target platform: any in " + str(platform_list), '') +opts.Add('target', "Compilation target (debug/release_debug/release)", 'debug') +opts.Add('tools', "Build the tools a.k.a. the Godot editor (yes/no)", 'yes') + +# Components +opts.Add('deprecated', "Enable deprecated features (yes/no)", 'yes') +opts.Add('gdscript', "Build GDSCript support (yes/no)", 'yes') +opts.Add('minizip', "Build minizip archive support (yes/no)", 'yes') +opts.Add('xaudio2', "XAudio2 audio driver (yes/no)", 'no') +opts.Add('xml', "XML format support for resources (yes/no)", 'yes') + +# Advanced options +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('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '') +opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '') +opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'yes') +opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no') + +# Thirdparty libraries +opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes') +opts.Add('builtin_freetype', "Use the builtin freetype library (yes/no)", 'yes') +opts.Add('builtin_glew', "Use the builtin glew library (yes/no)", 'yes') +opts.Add('builtin_libmpcdec', "Use the builtin libmpcdec library (yes/no)", 'yes') +opts.Add('builtin_libogg', "Use the builtin libogg library (yes/no)", 'yes') +opts.Add('builtin_libpng', "Use the builtin libpng library (yes/no)", 'yes') +opts.Add('builtin_libtheora', "Use the builtin libtheora library (yes/no)", 'yes') +opts.Add('builtin_libvorbis', "Use the builtin libvorbis library (yes/no)", 'yes') +opts.Add('builtin_libvpx', "Use the builtin libvpx library (yes/no)", 'yes') +opts.Add('builtin_libwebp', "Use the builtin libwebp library (yes/no)", 'yes') +opts.Add('builtin_openssl', "Use the builtin openssl library (yes/no)", 'yes') +opts.Add('builtin_opus', "Use the builtin opus library (yes/no)", 'yes') +opts.Add('builtin_squish', "Use the builtin squish library (yes/no)", 'yes') +opts.Add('builtin_zlib', "Use the builtin zlib library (yes/no)", 'yes') + +# Environment setup +opts.Add("CXX", "C++ compiler") +opts.Add("CC", "C compiler") +opts.Add("CCFLAGS", "Custom flags for the C and C++ compilers") opts.Add("CFLAGS", "Custom flags for the C compiler") opts.Add("LINKFLAGS", "Custom flags for the linker") -opts.Add('unix_global_settings_path', 'unix-specific path to system-wide settings. Currently only used by templates.', '') -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('verbose', 'Enable verbose output for the compilation (yes/no)', 'yes') -opts.Add('deprecated', 'Enable deprecated features (yes/no)', 'yes') -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 diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index efc925dae49..a968c10cfd8 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -4,7 +4,7 @@ Import('env') if (env["platform"] in ["haiku", "osx", "windows", "x11"]): # Thirdparty source files - if (env["glew"] != "system"): # builtin + if (env['builtin_glew'] != 'no'): # builtin thirdparty_dir = "#thirdparty/glew/" thirdparty_sources = [ "glew.c", diff --git a/drivers/png/SCsub b/drivers/png/SCsub index aedde3e2b74..6684e36b20c 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -5,7 +5,7 @@ Import('env') env_png = env.Clone() # Thirdparty source files -if (env["libpng"] == "builtin"): +if (env['builtin_libpng'] != 'no'): thirdparty_dir = "#thirdparty/libpng/" thirdparty_sources = [ "png.c", diff --git a/modules/enet/SCsub b/modules/enet/SCsub index 81881076039..fb22d1cff05 100644 --- a/modules/enet/SCsub +++ b/modules/enet/SCsub @@ -7,7 +7,7 @@ Import('env_modules') env_enet = env_modules.Clone() -if (env["enet"] != "system"): # builtin +if (env['builtin_enet'] != 'no'): thirdparty_dir = "#thirdparty/enet/" thirdparty_sources = [ "callbacks.c", diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index c68c40265c5..87652a3ddf9 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -5,7 +5,7 @@ Import('env') # Not building in a separate env as core needs it # Thirdparty source files -if (env["freetype"] != "system"): # builtin +if (env['builtin_freetype'] != 'no'): thirdparty_dir = "#thirdparty/freetype/" thirdparty_sources = [ "src/autofit/autofit.c", @@ -61,7 +61,7 @@ if (env["freetype"] != "system"): # builtin env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"]) # also requires libpng headers - if (env["libpng"] != "system"): # builtin + if (env['builtin_libpng'] != 'no'): env.Append(CPPPATH=["#thirdparty/libpng"]) """ FIXME: Remove this commented code if Windows can handle the monolithic lib diff --git a/modules/mpc/SCsub b/modules/mpc/SCsub index 80d2ab4abea..76b7cbea7a2 100644 --- a/modules/mpc/SCsub +++ b/modules/mpc/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_mpc = env_modules.Clone() # Thirdparty source files -if (env["libmpcdec"] != "system"): # builtin +if (env['builtin_libmpcdec'] != 'no'): thirdparty_dir = "#thirdparty/libmpcdec/" thirdparty_sources = [ "huffman.c", diff --git a/modules/ogg/SCsub b/modules/ogg/SCsub index 719ee4662b6..5eabaf6f2b5 100644 --- a/modules/ogg/SCsub +++ b/modules/ogg/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_ogg = env_modules.Clone() # Thirdparty source files -if (env["libogg"] != "system"): # builtin +if (env['builtin_libogg'] != 'no'): thirdparty_dir = "#thirdparty/libogg/" thirdparty_sources = [ "bitwise.c", diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub index bac80fb76e0..ccd90d15347 100644 --- a/modules/openssl/SCsub +++ b/modules/openssl/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_openssl = env_modules.Clone() # Thirdparty source files -if (env["openssl"] != "system"): # builtin +if (env['builtin_openssl'] != 'no'): thirdparty_dir = "#thirdparty/openssl/" thirdparty_sources = [ diff --git a/modules/opus/SCsub b/modules/opus/SCsub index e116fc46071..491380c826d 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_opus = env_modules.Clone() # Thirdparty source files -if (env["opus"] != "system"): # builtin +if (env['builtin_opus'] != 'no'): thirdparty_dir = "#thirdparty/opus/" thirdparty_sources = [ @@ -208,7 +208,7 @@ if (env["opus"] != "system"): # builtin env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) # also requires libogg - if (env["libogg"] != "system"): # builtin + if (env['builtin_libogg'] != 'no'): env_opus.Append(CPPPATH=["#thirdparty/libogg"]) # Module files diff --git a/modules/squish/SCsub b/modules/squish/SCsub index 462b6a05cf3..cca7c038f19 100644 --- a/modules/squish/SCsub +++ b/modules/squish/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_squish = env_modules.Clone() # Thirdparty source files -if (env["squish"] != "system"): # builtin +if (env['builtin_squish'] != 'no'): thirdparty_dir = "#thirdparty/squish/" thirdparty_sources = [ "alpha.cpp", diff --git a/modules/theora/SCsub b/modules/theora/SCsub index ff34b858795..2de4d296403 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_theora = env_modules.Clone() # Thirdparty source files -if (env["libtheora"] != "system"): # builtin +if (env['builtin_libtheora'] != 'no'): thirdparty_dir = "#thirdparty/libtheora/" thirdparty_sources = [ #"analyze.c", @@ -74,9 +74,9 @@ if (env["libtheora"] != "system"): # builtin env_theora.Append(CPPPATH=[thirdparty_dir]) # also requires libogg and libvorbis - if (env["libogg"] != "system"): # builtin + if (env['builtin_libogg'] != 'no'): env_theora.Append(CPPPATH=["#thirdparty/libogg"]) - if (env["libvorbis"] != "system"): # builtin + if (env['builtin_libvorbis'] != 'no'): env_theora.Append(CPPPATH=["#thirdparty/libvorbis"]) # Godot source files diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub index 3bd092105e4..d3e4f7e15ae 100644 --- a/modules/vorbis/SCsub +++ b/modules/vorbis/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_vorbis = env_modules.Clone() # Thirdparty source files -if (env["libvorbis"] != "system"): # builtin +if (env['builtin_libvorbis'] != 'no'): thirdparty_dir = "#thirdparty/libvorbis/" thirdparty_sources = [ #"analysis.c", @@ -42,7 +42,7 @@ if (env["libvorbis"] != "system"): # builtin env_vorbis.Append(CPPPATH=[thirdparty_dir]) # also requires libogg - if (env["libogg"] != "system"): # builtin + if (env['builtin_libogg'] != 'no'): env_vorbis.Append(CPPPATH=["#thirdparty/libogg"]) # Godot source files diff --git a/modules/webm/SCsub b/modules/webm/SCsub index c4a707b8e0b..e417fc0cbf6 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -19,14 +19,14 @@ env_webm.add_source_files(env.modules_sources, thirdparty_libsimplewebm_sources) env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"]) # also requires libogg, libvorbis and libopus -if (env["libogg"] != "system"): # builtin +if (env['builtin_libogg'] != 'no'): env_webm.Append(CPPPATH=["#thirdparty/libogg"]) -if (env["libvorbis"] != "system"): # builtin +if (env['builtin_libvorbis'] != 'no'): env_webm.Append(CPPPATH=["#thirdparty/libvorbis"]) -if (env["opus"] != "system"): # builtin +if (env['builtin_opus'] != 'no'): env_webm.Append(CPPPATH=["#thirdparty"]) -if (env["libvpx"] != "system"): # builtin +if (env['builtin_libvpx'] != 'no'): Export('env_webm') SConscript("libvpx/SCsub") diff --git a/modules/webp/SCsub b/modules/webp/SCsub index ab60bfd6b27..92f34c4da16 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -6,7 +6,7 @@ Import('env_modules') env_webp = env_modules.Clone() # Thirdparty source files -if (env["libwebp"] != "system"): # builtin +if (env['builtin_libwebp'] != 'no'): thirdparty_dir = "#thirdparty/libwebp/" thirdparty_sources = [ "enc/webpenc.c", diff --git a/platform/android/detect.py b/platform/android/detect.py index 23c4470b093..7f197895f13 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -37,7 +37,6 @@ def get_flags(): return [ ('tools', 'no'), - ('openssl', 'builtin'), # use builtin openssl ] diff --git a/platform/bb10/detect.py b/platform/bb10/detect.py index 95720794b2b..d3ee9f01246 100644 --- a/platform/bb10/detect.py +++ b/platform/bb10/detect.py @@ -37,7 +37,6 @@ def get_flags(): return [ ('tools', 'no'), - ('builtin_zlib', 'yes'), ('module_theora_enabled', 'no'), ] diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 229038697c2..b92b64e9f11 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -41,9 +41,6 @@ def get_flags(): return [ ('tools', 'no'), - ('webp', 'yes'), - ('builtin_zlib', 'yes'), - ('openssl', 'builtin'), # use builtin openssl ] diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index ec99392987e..9bc204a94a0 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -31,7 +31,6 @@ def get_flags(): return [ ('tools', 'no'), - ('builtin_zlib', 'yes'), ('module_etc1_enabled', 'no'), ('module_mpc_enabled', 'no'), ('module_theora_enabled', 'no'), diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 0576b0bfa9c..df5bc49aa4f 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -180,8 +180,6 @@ def get_opts(): def get_flags(): return [ - ('builtin_zlib', 'yes'), - ('openssl', 'builtin'), # use builtin openssl ] diff --git a/platform/winrt/detect.py b/platform/winrt/detect.py index 2156e593e84..6a1a06d8ab2 100644 --- a/platform/winrt/detect.py +++ b/platform/winrt/detect.py @@ -33,8 +33,6 @@ def get_flags(): return [ ('tools', 'no'), - ('builtin_zlib', 'yes'), - ('openssl', 'builtin'), ('xaudio2', 'yes'), ] diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 935a9fcc26c..d8cd79297e5 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -70,9 +70,10 @@ def get_opts(): def get_flags(): return [ - ("openssl", "system"), - ('freetype', 'system'), - ('libpng', 'system'), + ('builtin_freetype', 'no'), + ('builtin_libpng', 'no'), + ('builtin_openssl', 'no'), + ('builtin_zlib', 'no'), ] @@ -132,50 +133,50 @@ def configure(env): env.ParseConfig('pkg-config xcursor --cflags --libs') env.ParseConfig('pkg-config xrandr --cflags --libs') - if (env["openssl"] == "system"): + if (env['builtin_openssl'] == 'no'): env.ParseConfig('pkg-config openssl --cflags --libs') - if (env["libwebp"] == "system"): + if (env['builtin_libwebp'] == 'no'): env.ParseConfig('pkg-config libwebp --cflags --libs') - if (env["freetype"] == "system"): - env["libpng"] = "system" # Freetype links against libpng + if (env['builtin_freetype'] == 'no'): + env['builtin_libpng'] = 'no' # Freetype links against libpng env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env["libpng"] == "system"): + if (env['builtin_libpng'] == 'no'): env.ParseConfig('pkg-config libpng --cflags --libs') - if (env["enet"] == "system"): + if (env['builtin_enet'] == 'no'): env.ParseConfig('pkg-config libenet --cflags --libs') - if (env["squish"] == "system" and env["tools"] == "yes"): + if (env['builtin_squish'] == 'no' and env["tools"] == "yes"): env.ParseConfig('pkg-config libsquish --cflags --libs') # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) - if (env["libtheora"] == "system"): - env["libogg"] = "system" # Needed to link against system libtheora - env["libvorbis"] = "system" # Needed to link against system libtheora + if (env['builtin_libtheora'] == 'no'): + env['builtin_libogg'] = 'no' # Needed to link against system libtheora + env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora env.ParseConfig('pkg-config theora theoradec --cflags --libs') - if (env["libvpx"] == "system"): + if (env['builtin_libvpx'] == 'no'): env.ParseConfig('pkg-config vpx --cflags --libs') - if (env["libvorbis"] == "system"): - env["libogg"] = "system" # Needed to link against system libvorbis + if (env['builtin_libvorbis'] == 'no'): + env['builtin_libogg'] = 'no' # Needed to link against system libvorbis env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs') - if (env["opus"] == "system"): - env["libogg"] = "system" # Needed to link against system opus + if (env['builtin_opus'] == 'no'): + env['builtin_libogg'] = 'no' # Needed to link against system opus env.ParseConfig('pkg-config opus opusfile --cflags --libs') - if (env["libogg"] == "system"): + if (env['builtin_libogg'] == 'no'): env.ParseConfig('pkg-config ogg --cflags --libs') env.Append(CPPFLAGS=['-DOPENGL_ENABLED']) - if (env["glew"] == "system"): + if (env['builtin_glew'] == 'no'): env.ParseConfig('pkg-config glew --cflags --libs') if os.system("pkg-config --exists alsa") == 0: