SCons: Build thirdparty code in own env, disable warnings

Also remove unnecessary `Export('env')` in other SCsubs,
Export should only be used when exporting *new* objects.
This commit is contained in:
Rémi Verschelde 2018-09-28 13:29:52 +02:00
parent 243bdc4524
commit 3a2ca68af3
85 changed files with 229 additions and 225 deletions

View File

@ -123,6 +123,7 @@ env_base.__class__.add_shared_library = methods.add_shared_library
env_base.__class__.add_library = methods.add_library
env_base.__class__.add_program = methods.add_program
env_base.__class__.CommandNoCache = methods.CommandNoCache
env_base.__class__.disable_warnings = methods.disable_warnings
env_base["x86_libtheora_opt_gcc"] = False
env_base["x86_libtheora_opt_vc"] = False

View File

@ -56,6 +56,7 @@ with open("script_encryption_key.gen.cpp", "w") as f:
# Add required thirdparty code.
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
# Misc thirdparty code: header paths are hardcoded, we don't need to append
# to the include path (saves a few chars on the compiler invocation for touchy MSVC...)

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -4,5 +4,3 @@ Import('env')
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -11,6 +11,7 @@ thirdparty_sources = [
"b2Triangle.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.drivers_sources, thirdparty_sources)
Export('env')
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)

View File

@ -4,5 +4,3 @@ Import('env')
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -4,5 +4,3 @@ Import('env')
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -10,13 +10,14 @@ if (env["platform"] in ["haiku", "osx", "windows", "x11"]):
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.drivers_sources, thirdparty_sources)
env.Append(CPPPATH=[thirdparty_dir])
env.Append(CPPFLAGS=['-DGLAD_ENABLED'])
env.Append(CPPFLAGS=['-DGLES_OVER_GL'])
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
# Godot source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -2,6 +2,6 @@
Import('env')
env.add_source_files(env.drivers_sources,"*.cpp")
env.add_source_files(env.drivers_sources, "*.cpp")
SConscript("shaders/SCsub")

View File

@ -26,14 +26,22 @@ if env['builtin_libpng']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_png.add_source_files(env.drivers_sources, thirdparty_sources)
env_png.Append(CPPPATH=[thirdparty_dir])
# Currently .ASM filter_neon.S does not compile on NT.
import os
if ("neon_enabled" in env and env["neon_enabled"]) and os.name != "nt":
use_neon = "neon_enabled" in env and env["neon_enabled"] and os.name != "nt"
if use_neon:
env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"])
env_neon = env_png.Clone()
else:
env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])
env_thirdparty = env_png.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
if use_neon:
env_neon = env_thirdparty.Clone()
if "S_compiler" in env:
env_neon['CC'] = env['S_compiler']
neon_sources = []
@ -41,8 +49,6 @@ if env['builtin_libpng']:
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
env.drivers_sources += neon_sources
else:
env_png.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])
# Godot source files
env_png.add_source_files(env.drivers_sources, "*.cpp")

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -11,9 +11,12 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.drivers_sources, thirdparty_sources)
env.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")

View File

@ -5,5 +5,3 @@ Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
env["check_c_headers"] = [ [ "mntent.h", "HAVE_MNTENT" ] ]
Export('env')

View File

@ -4,5 +4,3 @@ Import('env')
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -4,5 +4,3 @@ Import('env')
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
Export('env')

View File

@ -5,5 +5,3 @@ Import('env')
env.add_source_files(env.drivers_sources, "*.cpp")
env.Append(CXXFLAGS=['-DXAUDIO2_ENABLED'])
env.Append(LINKFLAGS=['xaudio2_8.lib'])
Export('env')

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
Import('env')
env.editor_sources = []
import os
@ -89,5 +90,3 @@ if env['tools']:
lib = env.add_library("editor", env.editor_sources)
env.Prepend(LIBS=[lib])
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.editor_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.editor_sources, "*.cpp")
Export('env')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Export('env')
env.add_source_files(env.editor_sources, "*.cpp")

View File

@ -1,15 +1,13 @@
#!/usr/bin/env python
Import('env')
from platform_methods import run_in_subprocess
import editor_icons_builders
make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builders.make_editor_icons_action),
suffix='.h',
src_suffix='.svg')
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', Glob("*.svg"))])
Export('env')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Export('env')
env.add_source_files(env.editor_sources, "*.cpp")

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Export('env')
env.add_source_files(env.editor_sources, "*.cpp")

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
Import('env')
from platform_methods import run_in_subprocess
import main_builders
@ -15,8 +16,6 @@ env.CommandNoCache("#main/default_controller_mappings.gen.cpp", controller_datab
env.main_sources.append("#main/default_controller_mappings.gen.cpp")
Export('env')
env.Depends("#main/splash.gen.h", "#main/splash.png")
env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))

View File

@ -5,9 +5,5 @@ Import('env')
env.tests_sources = []
env.add_source_files(env.tests_sources, "*.cpp")
Export('env')
# SConscript('math/SCsub');
lib = env.add_library("tests", env.tests_sources)
env.Prepend(LIBS=[lib])

View File

@ -19,6 +19,14 @@ def add_source_files(self, sources, filetype, lib_env=None, shared=False):
sources.append(self.Object(path))
def disable_warnings(self):
# 'self' is the environment
if self.msvc:
self.Append(CCFLAGS=['/w'])
else:
self.Append(CCFLAGS=['-w'])
def add_module_version_string(self,s):
self.module_version_string += "." + s

View File

@ -9,7 +9,6 @@ Export('env_modules')
env.modules_sources = [
"register_module_types.gen.cpp",
]
Export('env')
for x in env.module_list:
if (x in env.disabled_modules):
@ -20,7 +19,6 @@ for x in env.module_list:
if env.split_modules:
env.split_lib("modules", env_lib = env_modules)
else:
lib = env_modules.add_library("modules", env.modules_sources)
env.Prepend(LIBS=[lib])

View File

@ -186,8 +186,12 @@ if env['builtin_bullet']:
thirdparty_sources = [thirdparty_dir + file for file in bullet2_src]
env_bullet.add_source_files(env.modules_sources, thirdparty_sources)
env_bullet.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_bullet.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_bullet.add_source_files(env.modules_sources, "*.cpp")

View File

@ -14,8 +14,11 @@ if env['builtin_squish']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_cvtt.add_source_files(env.modules_sources, thirdparty_sources)
env_cvtt.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_cvtt.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_cvtt.add_source_files(env.modules_sources, "*.cpp")

View File

@ -21,8 +21,11 @@ if env['builtin_enet']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_enet.add_source_files(env.modules_sources, thirdparty_sources)
env_enet.Append(CPPPATH=[thirdparty_dir])
env_enet.Append(CPPFLAGS=["-DGODOT_ENET"])
env_thirdparty = env_enet.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
env_enet.add_source_files(env.modules_sources, "*.cpp")

View File

@ -27,16 +27,20 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_etc.add_source_files(env.modules_sources, thirdparty_sources)
env_etc.Append(CPPPATH=[thirdparty_dir])
# Godot source files
env_etc.add_source_files(env.modules_sources, "*.cpp")
# upstream uses c++11
if (not env_etc.msvc):
if not env.msvc:
env_etc.Append(CCFLAGS="-std=c++11")
# -ffast-math seems to be incompatible with ec2comp on recent versions of
# -ffast-math seems to be incompatible with etc2comp on recent versions of
# GCC and Clang
if '-ffast-math' in env_etc['CCFLAGS']:
env_etc['CCFLAGS'].remove('-ffast-math')
env_thirdparty = env_etc.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_etc.add_source_files(env.modules_sources, "*.cpp")

View File

@ -73,6 +73,8 @@ if env['builtin_freetype']:
if env['builtin_libpng']:
env.Append(CPPPATH=["#thirdparty/libpng"])
# FIXME: Find a way to build this in a separate env nevertheless
# so that we can disable warnings on thirdparty code
lib = env.add_library("freetype_builtin", thirdparty_sources)
# Needs to be appended to arrive after libscene in the linker call,
# but we don't want it to arrive *after* system libs, so manual hack

View File

@ -1,35 +1,38 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
gdn_env = env.Clone()
gdn_env.add_source_files(env.modules_sources, "gdnative.cpp")
gdn_env.add_source_files(env.modules_sources, "register_types.cpp")
gdn_env.add_source_files(env.modules_sources, "android/*.cpp")
gdn_env.add_source_files(env.modules_sources, "gdnative/*.cpp")
gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp")
gdn_env.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
gdn_env.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
env_gdnative = env_modules.Clone()
env_gdnative.add_source_files(env.modules_sources, "gdnative.cpp")
env_gdnative.add_source_files(env.modules_sources, "register_types.cpp")
env_gdnative.add_source_files(env.modules_sources, "android/*.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative/*.cpp")
env_gdnative.add_source_files(env.modules_sources, "nativescript/*.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
gdn_env.Append(CPPPATH=['#modules/gdnative/include/'])
env_gdnative.Append(CPPPATH=['#modules/gdnative/include/'])
Export('env_gdnative')
SConscript("net/SCsub")
SConscript("arvr/SCsub")
SConscript("pluginscript/SCsub")
from platform_methods import run_in_subprocess
import gdnative_builders
_, gensource = gdn_env.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'],
_, gensource = env_gdnative.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'],
'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_api_struct))
gdn_env.add_source_files(env.modules_sources, [gensource])
env_gdnative.add_source_files(env.modules_sources, [gensource])
env.use_ptrcall = True
if ARGUMENTS.get('gdnative_wrapper', False):
gensource, = gdn_env.CommandNoCache('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_wrapper_code))
gensource, = env_gdnative.CommandNoCache('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_wrapper_code))
gd_wrapper_env = env.Clone()
gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/'])

View File

@ -1,13 +1,6 @@
#!/usr/bin/env python
import os
import methods
Import('env')
Import('env_modules')
env_arvr_gdnative = env_modules.Clone()
env_arvr_gdnative.Append(CPPPATH=['#modules/gdnative/include/'])
env_arvr_gdnative.add_source_files(env.modules_sources, '*.cpp')
Import('env_gdnative')
env_gdnative.add_source_files(env.modules_sources, '*.cpp')

View File

@ -1,12 +1,10 @@
#!/usr/bin/env python
Import('env')
Import('env_gdnative')
mod_env = env.Clone()
mod_env.add_source_files(env.modules_sources, "*.cpp")
mod_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
env_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_gdnative.Append(CPPFLAGS=['-DGDAPI_BUILT_IN'])
if "platform" in env and env["platform"] in ["x11", "iphone"]:
env.Append(LINKFLAGS=["-rdynamic"])
Export('mod_env')

View File

@ -1,12 +1,7 @@
#!/usr/bin/env python
import os
import methods
Import('env')
Import('env_modules')
Import('env_gdnative')
env_net_gdnative = env_modules.Clone()
env_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_net_gdnative.Append(CPPPATH=['#modules/gdnative/include/'])
env_net_gdnative.add_source_files(env.modules_sources, '*.cpp')

View File

@ -1,9 +1,6 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import('env_gdnative')
env_pluginscript = env_modules.Clone()
env_pluginscript.Append(CPPPATH=['#modules/gdnative/include/'])
env_pluginscript.add_source_files(env.modules_sources, '*.cpp')
env_gdnative.add_source_files(env.modules_sources, '*.cpp')

View File

@ -9,5 +9,3 @@ env_gdscript.add_source_files(env.modules_sources, "*.cpp")
if env['tools']:
env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp")
Export('env')

View File

@ -6,5 +6,3 @@ Import('env_modules')
env_gridmap = env_modules.Clone()
env_gridmap.add_source_files(env.modules_sources, "*.cpp")
Export('env')

View File

@ -13,8 +13,11 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_jpg.add_source_files(env.modules_sources, thirdparty_sources)
env_jpg.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_jpg.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot's own source files
env_jpg.add_source_files(env.modules_sources, "*.cpp")

View File

@ -91,8 +91,12 @@ if env['builtin_mbedtls']:
thirdparty_dir = "#thirdparty/mbedtls/library/"
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_mbed_tls.add_source_files(env.modules_sources, thirdparty_sources)
env_mbed_tls.Prepend(CPPPATH=["#thirdparty/mbedtls/include/"])
env_thirdparty = env_mbed_tls.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Module sources
env_mbed_tls.add_source_files(env.modules_sources, "*.cpp")

View File

@ -1,8 +1,5 @@
#!/usr/bin/env python
import os
import methods
Import('env')
Import('env_modules')

View File

@ -4,4 +4,3 @@ Import('env')
if 'GLES3_GLSL' in env['BUILDERS']:
env.GLES3_GLSL('lens_distorted.glsl');

View File

@ -14,8 +14,11 @@ if env['builtin_libogg']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_ogg.add_source_files(env.modules_sources, thirdparty_sources)
env_ogg.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_ogg.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_ogg.add_source_files(env.modules_sources, "*.cpp")

View File

@ -1,4 +1,22 @@
#!/usr/bin/env python
Import('env')
env.add_source_files(env.modules_sources, ["register_types.cpp", "open_simplex_noise.cpp", "noise_texture.cpp", "#thirdparty/misc/open-simplex-noise.c"])
Import('env_modules')
env_opensimplex = env_modules.Clone()
# Thirdparty source files
thirdparty_dir = "#thirdparty/misc/"
thirdparty_sources = [
"open-simplex-noise.c",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_opensimplex.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_opensimplex.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot's own source files
env_opensimplex.add_source_files(env.modules_sources, "*.cpp")

View File

@ -3,7 +3,6 @@
Import('env')
Import('env_modules')
stub = True
env_opus = env_modules.Clone()
@ -198,7 +197,10 @@ if env['builtin_opus']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources + opus_sources_silk]
env_opus.add_source_files(env.modules_sources, thirdparty_sources)
# also requires libogg
if env['builtin_libogg']:
env_opus.Append(CPPPATH=["#thirdparty/libogg"])
env_opus.Append(CFLAGS=["-DHAVE_CONFIG_H"])
thirdparty_include_paths = [
@ -211,9 +213,9 @@ if env['builtin_opus']:
]
env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])
# also requires libogg
if env['builtin_libogg']:
env_opus.Append(CPPPATH=["#thirdparty/libogg"])
env_thirdparty = env_opus.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
if not stub:
# Module files

View File

@ -17,8 +17,11 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_pvr.add_source_files(env.modules_sources, thirdparty_sources)
env_pvr.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_pvr.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_pvr.add_source_files(env.modules_sources, "*.cpp")

View File

@ -23,10 +23,11 @@ if env['builtin_recast']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_recast.add_source_files(env.modules_sources, thirdparty_sources)
env_recast.Append(CPPPATH=[thirdparty_dir + "/Include"])
env_thirdparty = env_recast.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_recast.add_source_files(env.modules_sources, "*.cpp")
Export('env')

View File

@ -4,15 +4,16 @@ Import('env')
Import('env_modules')
env_regex = env_modules.Clone()
env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
env_regex.add_source_files(env.modules_sources, "*.cpp")
if env['builtin_pcre2']:
jit_blacklist = ['javascript', 'uwp']
thirdparty_dir = '#thirdparty/pcre2/src/'
thirdparty_flags = ['-DPCRE2_STATIC', '-DHAVE_CONFIG_H']
if 'platform' in env and env['platform'] not in jit_blacklist:
thirdparty_flags.append('-DSUPPORT_JIT')
thirdparty_sources = [
"pcre2_auto_possess.c",
"pcre2_chartables.c",
@ -42,15 +43,21 @@ if env['builtin_pcre2']:
"pcre2_valid_utf.c",
"pcre2_xclass.c",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_regex.Append(CPPPATH=[thirdparty_dir])
env_regex.Append(CPPFLAGS=thirdparty_flags)
def pcre2_builtin(width):
env_pcre2 = env_modules.Clone()
env_pcre2 = env_regex.Clone()
env_pcre2.disable_warnings()
env_pcre2["OBJSUFFIX"] = "_" + width + env_pcre2["OBJSUFFIX"]
env_pcre2.Append(CPPPATH=[thirdparty_dir])
env_pcre2.add_source_files(env.modules_sources, thirdparty_sources)
env_pcre2.Append(CPPFLAGS=thirdparty_flags)
env_pcre2.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=" + width])
pcre2_builtin("16")
pcre2_builtin("32")
env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
env_regex.add_source_files(env.modules_sources, "*.cpp")

View File

@ -22,8 +22,11 @@ if env['builtin_squish']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_squish.add_source_files(env.modules_sources, thirdparty_sources)
env_squish.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_squish.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_squish.add_source_files(env.modules_sources, "*.cpp")

View File

@ -9,11 +9,12 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.modules_sources, thirdparty_sources)
env.Append(CPPPATH=[thirdparty_dir])
env.Append(CCFLAGS=["-DSVG_ENABLED"])
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot's own source files
env.add_source_files(env.modules_sources, "*.cpp")
Export('env')

View File

@ -54,17 +54,16 @@ if env['builtin_thekla_atlas']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_thekla_unwrap.add_source_files(env.modules_sources, thirdparty_sources)
env_thekla_unwrap.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/poshlib", thirdparty_dir + "/nvcore", thirdparty_dir + "/nvmesh"])
env_thekla_unwrap.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "poshlib", thirdparty_dir + "nvcore", thirdparty_dir + "nvmesh"])
# upstream uses c++11
if (not env_thekla_unwrap.msvc):
env_thekla_unwrap.Append(CXXFLAGS="-std=c++11")
if (not env.msvc):
env_thekla_unwrap.Append(CXXFLAGS="-std=c++11")
if env["platform"] == 'x11':
# if not specifically one of the *BSD, then use LINUX as default
if platform.system() == "FreeBSD":
env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
elif platform.system() == "OpenBSD":
env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
else:
@ -78,5 +77,9 @@ if env['builtin_thekla_atlas']:
env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
env.Append(LIBS=["dbghelp"])
env_thirdparty = env_thekla_unwrap.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp")

View File

@ -70,7 +70,6 @@ if env['builtin_libtheora']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_theora.add_source_files(env.modules_sources, thirdparty_sources)
env_theora.Append(CPPPATH=[thirdparty_dir])
# also requires libogg and libvorbis
@ -79,5 +78,9 @@ if env['builtin_libtheora']:
if env['builtin_libvorbis']:
env_theora.Append(CPPPATH=["#thirdparty/libvorbis"])
env_thirdparty = env_theora.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_theora.add_source_files(env.modules_sources, "*.cpp")

View File

@ -13,8 +13,11 @@ thirdparty_sources = [
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_tinyexr.add_source_files(env.modules_sources, thirdparty_sources)
env_tinyexr.Append(CPPPATH=[thirdparty_dir])
env_thirdparty = env_tinyexr.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot's own source files
env_tinyexr.add_source_files(env.modules_sources, "*.cpp")

View File

@ -25,8 +25,12 @@ if env['builtin_miniupnpc']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_upnp.add_source_files(env.modules_sources, thirdparty_sources)
env_upnp.Append(CPPPATH=[thirdparty_dir])
env_upnp.Append(CPPFLAGS=["-DMINIUPNP_STATICLIB"])
env_thirdparty = env_upnp.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_upnp.add_source_files(env.modules_sources, "*.cpp")

View File

@ -6,5 +6,3 @@ Import('env_modules')
env_vs = env_modules.Clone()
env_vs.add_source_files(env.modules_sources, "*.cpp")
Export('env')

View File

@ -40,13 +40,16 @@ if env['builtin_libvorbis']:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_vorbis.add_source_files(env.modules_sources, thirdparty_sources)
env_vorbis.Append(CPPPATH=[thirdparty_dir])
# also requires libogg
if env['builtin_libogg']:
env_vorbis.Append(CPPPATH=["#thirdparty/libogg"])
env_thirdparty = env_vorbis.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
if not stub:
# Module files
env_vorbis.add_source_files(env.modules_sources, "*.cpp")

View File

@ -6,17 +6,16 @@ Import('env_modules')
env_webm = env_modules.Clone()
# Thirdparty source files
thirdparty_libsimplewebm_dir = "#thirdparty/libsimplewebm/"
thirdparty_libsimplewebm_sources = [
thirdparty_dir = "#thirdparty/libsimplewebm/"
thirdparty_sources = [
"libwebm/mkvparser/mkvparser.cc",
"OpusVorbisDecoder.cpp",
"VPXDecoder.cpp",
"WebMDemuxer.cpp",
]
thirdparty_libsimplewebm_sources = [thirdparty_libsimplewebm_dir + file for file in thirdparty_libsimplewebm_sources]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_webm.add_source_files(env.modules_sources, thirdparty_libsimplewebm_sources)
env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"])
env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"])
# upstream uses c++11
if (not env_webm.msvc):
@ -31,8 +30,12 @@ if env['builtin_opus']:
env_webm.Append(CPPPATH=["#thirdparty/opus"])
if env['builtin_libvpx']:
Export('env_webm')
env_webm.Append(CPPPATH=["#thirdparty/libvpx"])
SConscript("libvpx/SCsub")
env_thirdparty = env_webm.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_webm.add_source_files(env.modules_sources, "*.cpp")

View File

@ -1,5 +1,10 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
# Thirdparty sources
libvpx_dir = "#thirdparty/libvpx/"
libvpx_sources = [
@ -249,12 +254,8 @@ libvpx_sources_arm_neon_armasm_ms = [libvpx_dir + file for file in libvpx_source
libvpx_sources_arm_neon_gas_apple = [libvpx_dir + file for file in libvpx_sources_arm_neon_gas_apple]
Import('env')
Import('env_webm')
env_webm.Append(CPPPATH=[libvpx_dir])
env_libvpx = env.Clone()
env_libvpx = env_modules.Clone()
env_libvpx.disable_warnings()
env_libvpx.Append(CPPPATH=[libvpx_dir])
webm_multithread = env["platform"] != 'javascript'

View File

@ -127,8 +127,11 @@ if env['builtin_libwebp']:
]
thirdparty_sources = [thirdparty_dir + "src/" + file for file in thirdparty_sources]
env_webp.add_source_files(env.modules_sources, thirdparty_sources)
env_webp.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "src/"])
env_thirdparty = env_webp.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
# Godot source files
env_webp.add_source_files(env.modules_sources, "*.cpp")

View File

@ -7,7 +7,7 @@ Import('env_modules')
env_lws = env_modules.Clone()
if env['builtin_libwebsockets']:
if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # already builtin for javascript
thirdparty_dir = "#thirdparty/libwebsockets/"
helper_dir = "win32helpers/"
thirdparty_sources = [
@ -61,34 +61,33 @@ if env['builtin_libwebsockets']:
"tls/mbedtls/mbedtls-server.c"
]
if env_lws["platform"] == "android": # Builtin getifaddrs
if env["platform"] == "android": # Builtin getifaddrs
thirdparty_sources += ["misc/getifaddrs.c"]
if env_lws["platform"] == "windows" or env_lws["platform"] == "uwp": # Winsock
if env["platform"] == "windows" or env["platform"] == "uwp": # Winsock
thirdparty_sources += ["plat/lws-plat-win.c", helper_dir + "getopt.c", helper_dir + "getopt_long.c", helper_dir + "gettimeofday.c"]
else: # Unix socket
thirdparty_sources += ["plat/lws-plat-unix.c"]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
if env_lws["platform"] == "javascript": # No need to add third party libraries at all
pass
else:
env_lws.add_source_files(env.modules_sources, thirdparty_sources)
env_lws.Append(CPPPATH=[thirdparty_dir])
env_lws.Append(CPPPATH=[thirdparty_dir])
wrapper_includes = ["#thirdparty/libwebsockets/tls/mbedtls/wrapper/include/" + inc for inc in ["internal", "openssl", "platform", ""]]
env_lws.Prepend(CPPPATH=wrapper_includes)
if env['builtin_mbedtls']:
mbedtls_includes = "#thirdparty/mbedtls/include"
env_lws.Prepend(CPPPATH=[mbedtls_includes])
if env['builtin_mbedtls']:
mbedtls_includes = "#thirdparty/mbedtls/include"
env_lws.Prepend(CPPPATH=[mbedtls_includes])
wrapper_includes = ["#thirdparty/libwebsockets/tls/mbedtls/wrapper/include/" + inc for inc in ["internal", "openssl", "platform", ""]]
env_lws.Prepend(CPPPATH=wrapper_includes)
if env_lws["platform"] == "windows" or env_lws["platform"] == "uwp":
env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir])
if env["platform"] == "windows" or env["platform"] == "uwp":
env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir])
if env_lws["platform"] == "uwp":
env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"])
if env["platform"] == "uwp":
env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"])
env_thirdparty = env_lws.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
env_lws.add_source_files(env.modules_sources, "*.cpp")

View File

@ -29,5 +29,3 @@ platform_sources.append('register_platform_apis.gen.cpp')
lib = env.add_library('platform', platform_sources)
env.Prepend(LIBS=lib)
Export('env')

View File

@ -1,12 +1,12 @@
#!/usr/bin/env python
Import('env')
import shutil
from compat import open_utf8
from distutils.version import LooseVersion
from detect import get_ndk_version
Import('env')
android_files = [
'os_android.cpp',
@ -26,10 +26,6 @@ android_files = [
# 'power_android.cpp'
]
# env.Depends('#core/math/vector3.h', 'vector3_psp.h')
#obj = env.SharedObject('godot_android.cpp')
env_android = env.Clone()
if env['target'] == "profile":
env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED'])
@ -174,4 +170,4 @@ if lib_arch_dir != '':
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
stl_lib_path = str(env['ANDROID_NDK_ROOT']) + '/sources/cxx-stl/llvm-libc++/libs/' + lib_arch_dir + '/libc++_shared.so'
env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE"))
env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE"))

View File

@ -1,8 +1,9 @@
#!/usr/bin/env python
import os
Import('env')
import os
iphone_lib = [
'godot_iphone.cpp',
'os_iphone.cpp',

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
import os
Import('env')
import os
from platform_methods import run_in_subprocess
import platform_osx_builders

View File

@ -2,11 +2,9 @@
Import('env')
common_server = [\
"os_server.cpp",\
"#platform/x11/crash_handler_x11.cpp",
"#platform/x11/power_x11.cpp",
]
prog = env.add_program('#bin/godot_server', ['godot_server.cpp'] + common_server)

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
import os
Import('env')
import os
from platform_methods import run_in_subprocess
import platform_windows_builders
@ -19,9 +19,7 @@ common_win = [
]
res_file = 'godot_res.rc'
res_target = "godot_res" + env["OBJSUFFIX"]
res_obj = env.RES(res_target, res_file)
prog = env.add_program('#bin/godot', common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"])

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
import os
Import('env')
import os
from platform_methods import run_in_subprocess
import platform_x11_builders

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -2,9 +2,7 @@
Import('env')
if env['disable_3d']:
env.scene_sources.append("3d/spatial.cpp")
env.scene_sources.append("3d/skeleton.cpp")
env.scene_sources.append("3d/particles.cpp")
@ -12,5 +10,3 @@ if env['disable_3d']:
env.scene_sources.append("3d/scenario_fx.cpp")
else:
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -4,7 +4,6 @@ Import('env')
env.scene_sources = []
# Thirdparty code
thirdparty_dir = "#thirdparty/misc/"
thirdparty_sources = [
@ -12,8 +11,10 @@ thirdparty_sources = [
"mikktspace.c",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.scene_sources, thirdparty_sources)
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.scene_sources, thirdparty_sources)
# Godot's own sources
env.add_source_files(env.scene_sources, "*.cpp")
@ -32,5 +33,3 @@ SConscript('resources/SCsub')
# Build it all as a library
lib = env.add_library("scene", env.scene_sources)
env.Prepend(LIBS=[lib])
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -4,6 +4,4 @@ Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')
SConscript("default_theme/SCsub")

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.scene_sources, "*.cpp")
Export('env')

View File

@ -5,8 +5,6 @@ Import('env')
env.servers_sources = []
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')
SConscript('arvr/SCsub')
SConscript('physics/SCsub')
SConscript('physics_2d/SCsub')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')

View File

@ -4,6 +4,4 @@ Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')
SConscript("effects/SCsub")

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')

View File

@ -4,6 +4,4 @@ Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')
SConscript("joints/SCsub")

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')

View File

@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
Export('env')