SCons: Add explicit dependencies on thirdparty code in cloned env

Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
This commit is contained in:
Rémi Verschelde 2020-12-17 16:01:36 +01:00
parent 5332d212f9
commit c7b53c03ae
No known key found for this signature in database
GPG Key ID: C3336907360768E1
50 changed files with 601 additions and 164 deletions

View File

@ -38,6 +38,9 @@ with open("script_encryption_key.gen.cpp", "w") as f:
# Add required thirdparty code. # Add required thirdparty code.
thirdparty_obj = []
env_thirdparty = env.Clone() env_thirdparty = env.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
@ -55,7 +58,7 @@ thirdparty_misc_sources = [
"clipper.cpp", "clipper.cpp",
] ]
thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_misc_sources] thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_misc_sources]
env_thirdparty.add_source_files(env.core_sources, thirdparty_misc_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_misc_sources)
# Zlib library, can be unbundled # Zlib library, can be unbundled
if env["builtin_zlib"]: if env["builtin_zlib"]:
@ -81,14 +84,14 @@ if env["builtin_zlib"]:
if env["target"] == "debug": if env["target"] == "debug":
env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"]) env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"])
env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_zlib_sources)
# Minizip library, could be unbundled in theory # Minizip library, could be unbundled in theory
# However, our version has some custom modifications, so it won't compile with the system one # However, our version has some custom modifications, so it won't compile with the system one
thirdparty_minizip_dir = "#thirdparty/minizip/" thirdparty_minizip_dir = "#thirdparty/minizip/"
thirdparty_minizip_sources = ["ioapi.c", "unzip.c", "zip.c"] thirdparty_minizip_sources = ["ioapi.c", "unzip.c", "zip.c"]
thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources] thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
env_thirdparty.add_source_files(env.core_sources, thirdparty_minizip_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_minizip_sources)
# Zstd library, can be unbundled in theory # Zstd library, can be unbundled in theory
# though we currently use some private symbols # though we currently use some private symbols
@ -130,10 +133,14 @@ if env["builtin_zstd"]:
# Also needed in main env includes will trigger warnings # Also needed in main env includes will trigger warnings
env.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"]) env.Append(CPPDEFINES=["ZSTD_STATIC_LINKING_ONLY"])
env_thirdparty.add_source_files(env.core_sources, thirdparty_zstd_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_zstd_sources)
# Godot's own sources env.core_sources += thirdparty_obj
# Godot source files
env.add_source_files(env.core_sources, "*.cpp") env.add_source_files(env.core_sources, "*.cpp")
# Certificates # Certificates
@ -185,3 +192,6 @@ SConscript("error/SCsub")
# Build it all as a library # Build it all as a library
lib = env.add_library("core", env.core_sources) lib = env.add_library("core", env.core_sources)
env.Prepend(LIBS=[lib]) env.Prepend(LIBS=[lib])
# Needed to force rebuilding the core files when the thirdparty code is updated.
env.Depends(lib, thirdparty_obj)

View File

@ -6,6 +6,7 @@ env_crypto = env.Clone()
is_builtin = env["builtin_mbedtls"] is_builtin = env["builtin_mbedtls"]
has_module = env["module_mbedtls_enabled"] has_module = env["module_mbedtls_enabled"]
thirdparty_obj = []
if is_builtin or not has_module: if is_builtin or not has_module:
# Use our headers for builtin or if the module is not going to be compiled. # Use our headers for builtin or if the module is not going to be compiled.
@ -35,6 +36,16 @@ if not has_module:
"godot_core_mbedtls_platform.c", "godot_core_mbedtls_platform.c",
] ]
thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources] thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources]
env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_mbedtls_sources)
env.core_sources += thirdparty_obj
env_crypto.add_source_files(env.core_sources, "*.cpp")
# Godot source files
core_obj = []
env_crypto.add_source_files(core_obj, "*.cpp")
env.core_sources += core_obj
# Needed to force rebuilding the core files when the thirdparty library is updated.
env.Depends(core_obj, thirdparty_obj)

View File

@ -5,6 +5,9 @@ Import("env")
env_png = env.Clone() env_png = env.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_libpng"]: if env["builtin_libpng"]:
thirdparty_dir = "#thirdparty/libpng/" thirdparty_dir = "#thirdparty/libpng/"
thirdparty_sources = [ thirdparty_sources = [
@ -41,7 +44,7 @@ if env["builtin_libpng"]:
env_thirdparty = env_png.Clone() env_thirdparty = env_png.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
if use_neon: if use_neon:
env_neon = env_thirdparty.Clone() env_neon = env_thirdparty.Clone()
@ -52,9 +55,17 @@ 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_intrinsics.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S")) neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c"))
env.drivers_sources += neon_sources thirdparty_obj += neon_sources
env.drivers_sources += thirdparty_obj
# Godot source files # Godot source files
env_png.add_source_files(env.drivers_sources, "*.cpp")
Export("env") driver_obj = []
env_png.add_source_files(driver_obj, "*.cpp")
env.drivers_sources += driver_obj
# Needed to force rebuilding the driver files when the thirdparty library is updated.
env.Depends(driver_obj, thirdparty_obj)

View File

@ -2,8 +2,7 @@
Import("env") Import("env")
env_spirv_reflect = env.Clone() # Thirdparty source files
env_spirv_reflect.disable_warnings()
thirdparty_dir = "#thirdparty/spirv-reflect/" thirdparty_dir = "#thirdparty/spirv-reflect/"
thirdparty_sources = [ thirdparty_sources = [
@ -12,6 +11,7 @@ thirdparty_sources = [
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_spirv_reflect.add_source_files(env.drivers_sources, thirdparty_sources) env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
Export("env") env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)

View File

@ -2,7 +2,7 @@
Import("env") Import("env")
env.add_source_files(env.drivers_sources, "*.cpp") thirdparty_obj = []
# FIXME: Refactor all this to reduce code duplication. # FIXME: Refactor all this to reduce code duplication.
if env["platform"] == "android": if env["platform"] == "android":
@ -22,7 +22,8 @@ if env["platform"] == "android":
thirdparty_dir = "#thirdparty/vulkan" thirdparty_dir = "#thirdparty/vulkan"
vma_sources = [thirdparty_dir + "/android/vk_mem_alloc.cpp"] vma_sources = [thirdparty_dir + "/android/vk_mem_alloc.cpp"]
env_thirdparty.add_source_files(env.drivers_sources, vma_sources) env_thirdparty.add_source_files(thirdparty_obj, vma_sources)
elif env["platform"] == "iphone": elif env["platform"] == "iphone":
# Use bundled Vulkan headers # Use bundled Vulkan headers
thirdparty_dir = "#thirdparty/vulkan" thirdparty_dir = "#thirdparty/vulkan"
@ -33,7 +34,8 @@ elif env["platform"] == "iphone":
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"] vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"]
env_thirdparty.add_source_files(env.drivers_sources, vma_sources) env_thirdparty.add_source_files(thirdparty_obj, vma_sources)
elif env["builtin_vulkan"]: elif env["builtin_vulkan"]:
# Use bundled Vulkan headers # Use bundled Vulkan headers
thirdparty_dir = "#thirdparty/vulkan" thirdparty_dir = "#thirdparty/vulkan"
@ -98,8 +100,9 @@ elif env["builtin_vulkan"]:
env_thirdparty.AppendUnique(CPPDEFINES=["HAVE_SECURE_GETENV"]) env_thirdparty.AppendUnique(CPPDEFINES=["HAVE_SECURE_GETENV"])
loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources] loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
env_thirdparty.add_source_files(env.drivers_sources, loader_sources) env_thirdparty.add_source_files(thirdparty_obj, loader_sources)
env_thirdparty.add_source_files(env.drivers_sources, vma_sources) env_thirdparty.add_source_files(thirdparty_obj, vma_sources)
else: # Always build VMA. else: # Always build VMA.
thirdparty_dir = "#thirdparty/vulkan" thirdparty_dir = "#thirdparty/vulkan"
env.Prepend(CPPPATH=[thirdparty_dir]) env.Prepend(CPPPATH=[thirdparty_dir])
@ -109,4 +112,18 @@ else: # Always build VMA.
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"] vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"]
env_thirdparty.add_source_files(env.drivers_sources, vma_sources) env_thirdparty.add_source_files(thirdparty_obj, vma_sources)
env.drivers_sources += thirdparty_obj
# Godot source files
driver_obj = []
env.add_source_files(driver_obj, "*.cpp")
env.drivers_sources += driver_obj
# Needed to force rebuilding the driver files when the thirdparty code is updated.
env.Depends(driver_obj, thirdparty_obj)

View File

@ -5,8 +5,13 @@ Import("env_modules")
env_assimp = env_modules.Clone() env_assimp = env_modules.Clone()
# Thirdparty source files
thirdparty_obj = []
# Force bundled version for now, there's no released version of Assimp with # Force bundled version for now, there's no released version of Assimp with
# support for ArmaturePopulate which we use from their master branch. # support for ArmaturePopulate which we use from their master branch.
if True: # env['builtin_assimp']: if True: # env['builtin_assimp']:
thirdparty_dir = "#thirdparty/assimp" thirdparty_dir = "#thirdparty/assimp"
@ -84,11 +89,20 @@ if True: # env['builtin_assimp']:
env_thirdparty = env_assimp.Clone() env_thirdparty = env_assimp.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/CApi/*.cpp")) env_thirdparty.add_source_files(thirdparty_obj, Glob("#thirdparty/assimp/code/CApi/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/Common/*.cpp")) env_thirdparty.add_source_files(thirdparty_obj, Glob("#thirdparty/assimp/code/Common/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/PostProcessing/*.cpp")) env_thirdparty.add_source_files(thirdparty_obj, Glob("#thirdparty/assimp/code/PostProcessing/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/Material/*.cpp")) env_thirdparty.add_source_files(thirdparty_obj, Glob("#thirdparty/assimp/code/Material/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/FBX/*.cpp")) env_thirdparty.add_source_files(thirdparty_obj, Glob("#thirdparty/assimp/code/FBX/*.cpp"))
env.modules_sources += thirdparty_obj
# Godot's own source files
env_assimp.add_source_files(env.modules_sources, "*.cpp") # Godot source files
module_obj = []
env_assimp.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_basisu = env_modules.Clone() env_basisu = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
# Not unbundled so far since not widespread as shared library # Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/basis_universal/" thirdparty_dir = "#thirdparty/basis_universal/"
tool_sources = [ tool_sources = [
@ -41,8 +44,16 @@ if env["target"] == "debug":
env_thirdparty = env_basisu.Clone() env_thirdparty = env_basisu.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
if env["tools"]: if env["tools"]:
env_thirdparty.add_source_files(env.modules_sources, tool_sources) env_thirdparty.add_source_files(thirdparty_obj, tool_sources)
env_thirdparty.add_source_files(env.modules_sources, transcoder_sources) env_thirdparty.add_source_files(thirdparty_obj, transcoder_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_basisu.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_basisu.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -7,6 +7,8 @@ env_bullet = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_bullet"]: if env["builtin_bullet"]:
# Build only version 2 for now (as of 2.89) # Build only version 2 for now (as of 2.89)
# Sync file list with relevant upstream CMakeLists.txt for each folder. # Sync file list with relevant upstream CMakeLists.txt for each folder.
@ -208,8 +210,16 @@ if env["builtin_bullet"]:
env_thirdparty = env_bullet.Clone() env_thirdparty = env_bullet.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_bullet.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_bullet.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_cvtt = env_modules.Clone() env_cvtt = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/cvtt/" thirdparty_dir = "#thirdparty/cvtt/"
thirdparty_sources = [ thirdparty_sources = [
"ConvectionKernels.cpp", "ConvectionKernels.cpp",
@ -17,7 +20,15 @@ env_cvtt.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_cvtt.Clone() env_thirdparty = env_cvtt.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_cvtt.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_cvtt.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -8,6 +8,9 @@ Import("env_modules")
env_oidn = env_modules.Clone() env_oidn = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/oidn/" thirdparty_dir = "#thirdparty/oidn/"
thirdparty_sources = [ thirdparty_sources = [
"core/api.cpp", "core/api.cpp",
@ -106,7 +109,8 @@ env_oidn.Append(
env_thirdparty = env_oidn.Clone() env_thirdparty = env_oidn.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
weights_in_path = thirdparty_dir + "weights/rtlightmap_hdr.tza" weights_in_path = thirdparty_dir + "weights/rtlightmap_hdr.tza"
weights_out_path = thirdparty_dir + "weights/rtlightmap_hdr.gen.cpp" weights_out_path = thirdparty_dir + "weights/rtlightmap_hdr.gen.cpp"
@ -114,5 +118,12 @@ weights_out_path = thirdparty_dir + "weights/rtlightmap_hdr.gen.cpp"
env_thirdparty.Depends(weights_out_path, weights_in_path) env_thirdparty.Depends(weights_out_path, weights_in_path)
env_thirdparty.CommandNoCache(weights_out_path, weights_in_path, resource_to_cpp.tza_to_cpp) env_thirdparty.CommandNoCache(weights_out_path, weights_in_path, resource_to_cpp.tza_to_cpp)
env_oidn.add_source_files(env.modules_sources, "denoise_wrapper.cpp") # Godot source files
env_modules.add_source_files(env.modules_sources, ["register_types.cpp", "lightmap_denoiser.cpp"])
module_obj = []
env_oidn.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -7,6 +7,8 @@ env_enet = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_enet"]: if env["builtin_enet"]:
thirdparty_dir = "#thirdparty/enet/" thirdparty_dir = "#thirdparty/enet/"
thirdparty_sources = [ thirdparty_sources = [
@ -26,6 +28,16 @@ if env["builtin_enet"]:
env_thirdparty = env_enet.Clone() env_thirdparty = env_enet.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
env_enet.add_source_files(env.modules_sources, "*.cpp")
# Godot source files
module_obj = []
env_enet.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_etc = env_modules.Clone() env_etc = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
# Not unbundled so far since not widespread as shared library # Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/etc2comp/" thirdparty_dir = "#thirdparty/etc2comp/"
thirdparty_sources = [ thirdparty_sources = [
@ -31,7 +34,15 @@ env_etc.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_etc.Clone() env_thirdparty = env_etc.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_etc.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_etc.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_freetype = env_modules.Clone() env_freetype = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_freetype"]: if env["builtin_freetype"]:
thirdparty_dir = "#thirdparty/freetype/" thirdparty_dir = "#thirdparty/freetype/"
thirdparty_sources = [ thirdparty_sources = [
@ -84,6 +87,7 @@ if env["builtin_freetype"]:
env_thirdparty = env_freetype.Clone() env_thirdparty = env_freetype.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
lib = env_thirdparty.add_library("freetype_builtin", thirdparty_sources) lib = env_thirdparty.add_library("freetype_builtin", thirdparty_sources)
thirdparty_obj += lib
# Needs to be appended to arrive after libscene in the linker call, # 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 # but we don't want it to arrive *after* system libs, so manual hack
@ -98,5 +102,13 @@ if env["builtin_freetype"]:
if not inserted: if not inserted:
env.Append(LIBS=[lib]) env.Append(LIBS=[lib])
# Godot source files # Godot source files
env_freetype.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_freetype.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -5,6 +5,10 @@ Import("env_modules")
env_navigation = env_modules.Clone() env_navigation = env_modules.Clone()
# Thirdparty source files
thirdparty_obj = []
# Recast Thirdparty source files # Recast Thirdparty source files
if env["builtin_recast"]: if env["builtin_recast"]:
thirdparty_dir = "#thirdparty/recastnavigation/Recast/" thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
@ -23,28 +27,37 @@ if env["builtin_recast"]:
] ]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_navigation.Prepend(CPPPATH=[thirdparty_dir + "/Include"]) env_navigation.Prepend(CPPPATH=[thirdparty_dir + "Include"])
env_thirdparty = env_navigation.Clone() env_thirdparty = env_navigation.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
# RVO Thirdparty source files # RVO Thirdparty source files
if env["builtin_rvo2"]: if env["builtin_rvo2"]:
thirdparty_dir = "#thirdparty/rvo2" thirdparty_dir = "#thirdparty/rvo2/"
thirdparty_sources = [ thirdparty_sources = [
"/src/Agent.cpp", "Agent.cpp",
"/src/KdTree.cpp", "KdTree.cpp",
] ]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_navigation.Prepend(CPPPATH=[thirdparty_dir + "/src"]) env_navigation.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_navigation.Clone() env_thirdparty = env_navigation.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_navigation.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_navigation.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_glslang = env_modules.Clone() env_glslang = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_glslang"]: if env["builtin_glslang"]:
thirdparty_dir = "#thirdparty/glslang/" thirdparty_dir = "#thirdparty/glslang/"
thirdparty_sources = [ thirdparty_sources = [
@ -70,7 +73,16 @@ if env["builtin_glslang"]:
env_thirdparty = env_glslang.Clone() env_thirdparty = env_glslang.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files
env_glslang.add_source_files(env.modules_sources, "*.cpp") # Godot source files
module_obj = []
env_glslang.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_jpg = env_modules.Clone() env_jpg = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
# Not unbundled for now as they are not commonly available as shared library # Not unbundled for now as they are not commonly available as shared library
thirdparty_dir = "#thirdparty/jpeg-compressor/" thirdparty_dir = "#thirdparty/jpeg-compressor/"
thirdparty_sources = [ thirdparty_sources = [
@ -17,7 +20,15 @@ env_jpg.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_jpg.Clone() env_thirdparty = env_jpg.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files # Godot source files
env_jpg.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_jpg.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -5,8 +5,11 @@ Import("env_modules")
env_mbed_tls = env_modules.Clone() env_mbed_tls = env_modules.Clone()
# Thirdparty source files
thirdparty_obj = []
if env["builtin_mbedtls"]: if env["builtin_mbedtls"]:
# Thirdparty source files
thirdparty_sources = [ thirdparty_sources = [
"aes.c", "aes.c",
"aesni.c", "aesni.c",
@ -96,11 +99,21 @@ if env["builtin_mbedtls"]:
env_thirdparty = env_mbed_tls.Clone() env_thirdparty = env_mbed_tls.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Module sources
env_mbed_tls.add_source_files(env.modules_sources, "*.cpp") # Godot source files
module_obj = []
env_mbed_tls.add_source_files(module_obj, "*.cpp")
if env["tests"]: if env["tests"]:
env_mbed_tls.Append(CPPDEFINES=["TESTS_ENABLED"]) env_mbed_tls.Append(CPPDEFINES=["TESTS_ENABLED"])
env_mbed_tls.add_source_files(env.modules_sources, "./tests/*.cpp") env_mbed_tls.add_source_files(module_obj, "./tests/*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_meshoptimizer = env_modules.Clone() env_meshoptimizer = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/meshoptimizer/" thirdparty_dir = "#thirdparty/meshoptimizer/"
thirdparty_sources = [ thirdparty_sources = [
"allocator.cpp", "allocator.cpp",
@ -26,9 +29,17 @@ thirdparty_sources = [
] ]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_thirdparty = env_meshoptimizer.Clone() env_thirdparty = env_meshoptimizer.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
env_modules.add_source_files(env.modules_sources, ["register_types.cpp"]) # Godot source files
module_obj = []
env_meshoptimizer.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -9,6 +9,9 @@ Import("env_modules")
env_ogg = env_modules.Clone() env_ogg = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_libogg"]: if env["builtin_libogg"]:
thirdparty_dir = "#thirdparty/libogg/" thirdparty_dir = "#thirdparty/libogg/"
thirdparty_sources = [ thirdparty_sources = [
@ -21,7 +24,16 @@ if env["builtin_libogg"]:
env_thirdparty = env_ogg.Clone() env_thirdparty = env_ogg.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_ogg.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_ogg.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_opensimplex = env_modules.Clone() env_opensimplex = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/misc/" thirdparty_dir = "#thirdparty/misc/"
thirdparty_sources = [ thirdparty_sources = [
"open-simplex-noise.c", "open-simplex-noise.c",
@ -16,7 +19,15 @@ env_opensimplex.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_opensimplex.Clone() env_thirdparty = env_opensimplex.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files # Godot source files
env_opensimplex.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_opensimplex.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -9,6 +9,10 @@ Import("env_modules")
env_opus = env_modules.Clone() env_opus = env_modules.Clone()
# Thirdparty source files
thirdparty_obj = []
# Thirdparty source files # Thirdparty source files
if env["builtin_opus"]: if env["builtin_opus"]:
thirdparty_dir = "#thirdparty/opus/" thirdparty_dir = "#thirdparty/opus/"
@ -233,7 +237,16 @@ if env["builtin_opus"]:
env_thirdparty = env_opus.Clone() env_thirdparty = env_opus.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Module files
env_opus.add_source_files(env.modules_sources, "register_types.cpp") # Godot source files
module_obj = []
env_opus.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_pvr = env_modules.Clone() env_pvr = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
# Not unbundled so far since not widespread as shared library # Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/pvrtccompressor/" thirdparty_dir = "#thirdparty/pvrtccompressor/"
thirdparty_sources = [ thirdparty_sources = [
@ -21,7 +24,15 @@ env_pvr.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_pvr.Clone() env_thirdparty = env_pvr.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_pvr.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_pvr.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -5,6 +5,10 @@ Import("env_modules")
env_regex = env_modules.Clone() env_regex = env_modules.Clone()
# Thirdparty source files
thirdparty_obj = []
if env["builtin_pcre2"]: if env["builtin_pcre2"]:
thirdparty_dir = "#thirdparty/pcre2/src/" thirdparty_dir = "#thirdparty/pcre2/src/"
thirdparty_flags = ["PCRE2_STATIC", "HAVE_CONFIG_H", "SUPPORT_UNICODE"] thirdparty_flags = ["PCRE2_STATIC", "HAVE_CONFIG_H", "SUPPORT_UNICODE"]
@ -52,11 +56,21 @@ if env["builtin_pcre2"]:
env_pcre2 = env_regex.Clone() env_pcre2 = env_regex.Clone()
env_pcre2.disable_warnings() env_pcre2.disable_warnings()
env_pcre2["OBJSUFFIX"] = "_" + width + env_pcre2["OBJSUFFIX"] env_pcre2["OBJSUFFIX"] = "_" + width + env_pcre2["OBJSUFFIX"]
env_pcre2.add_source_files(env.modules_sources, thirdparty_sources)
env_pcre2.Append(CPPDEFINES=[("PCRE2_CODE_UNIT_WIDTH", width)]) env_pcre2.Append(CPPDEFINES=[("PCRE2_CODE_UNIT_WIDTH", width)])
env_pcre2.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
pcre2_builtin("16") pcre2_builtin("16")
pcre2_builtin("32") pcre2_builtin("32")
# Godot source files
module_obj = []
env_regex.Append(CPPDEFINES=[("PCRE2_CODE_UNIT_WIDTH", 0)]) env_regex.Append(CPPDEFINES=[("PCRE2_CODE_UNIT_WIDTH", 0)])
env_regex.add_source_files(env.modules_sources, "*.cpp") env_regex.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_squish = env_modules.Clone() env_squish = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_squish"]: if env["builtin_squish"]:
thirdparty_dir = "#thirdparty/squish/" thirdparty_dir = "#thirdparty/squish/"
thirdparty_sources = [ thirdparty_sources = [
@ -26,7 +29,16 @@ if env["builtin_squish"]:
env_thirdparty = env_squish.Clone() env_thirdparty = env_squish.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_squish.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_squish.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,11 +6,22 @@ Import("env_modules")
env_stb_vorbis = env_modules.Clone() env_stb_vorbis = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_sources = ["#thirdparty/misc/stb_vorbis.c"] thirdparty_sources = ["#thirdparty/misc/stb_vorbis.c"]
env_thirdparty = env_stb_vorbis.Clone() env_thirdparty = env_stb_vorbis.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files # Godot source files
env_stb_vorbis.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_stb_vorbis.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_svg = env_modules.Clone() env_svg = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/nanosvg/" thirdparty_dir = "#thirdparty/nanosvg/"
thirdparty_sources = [ thirdparty_sources = [
"nanosvg.cc", "nanosvg.cc",
@ -16,7 +19,15 @@ env_svg.Prepend(CPPPATH=[thirdparty_dir])
env_thirdparty = env_svg.Clone() env_thirdparty = env_svg.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files # Godot source files
env_svg.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_svg.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -35,10 +35,14 @@ def make_icu_data(target, source, env):
g.write("#endif") g.write("#endif")
# Thirdparty source files
thirdparty_obj = []
if env["builtin_harfbuzz"]: if env["builtin_harfbuzz"]:
env_harfbuzz = env_modules.Clone() env_harfbuzz = env_modules.Clone()
env_harfbuzz.disable_warnings()
# Thirdparty source files
thirdparty_dir = "#thirdparty/harfbuzz/" thirdparty_dir = "#thirdparty/harfbuzz/"
thirdparty_sources = [ thirdparty_sources = [
"src/hb-aat-layout.cc", "src/hb-aat-layout.cc",
@ -107,6 +111,15 @@ if env["builtin_harfbuzz"]:
] ]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_harfbuzz.Append(
CPPPATH=[
"#thirdparty/harfbuzz/src",
"#thirdparty/freetype/include",
"#thirdparty/graphite/include",
"#thirdparty/icu4c/common/",
]
)
if env["platform"] == "android" or env["platform"] == "linuxbsd" or env["platform"] == "server": if env["platform"] == "android" or env["platform"] == "linuxbsd" or env["platform"] == "server":
env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"]) env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"])
@ -116,14 +129,6 @@ if env["builtin_harfbuzz"]:
else: else:
env_harfbuzz.Append(CCFLAGS=["-DHB_NO_MT"]) env_harfbuzz.Append(CCFLAGS=["-DHB_NO_MT"])
env_harfbuzz.Append(
CPPPATH=[
"#thirdparty/harfbuzz/src",
"#thirdparty/freetype/include",
"#thirdparty/graphite/include",
"#thirdparty/icu4c/common/",
]
)
env_harfbuzz.Append( env_harfbuzz.Append(
CCFLAGS=[ CCFLAGS=[
"-DHAVE_ICU_BUILTIN", "-DHAVE_ICU_BUILTIN",
@ -133,10 +138,9 @@ if env["builtin_harfbuzz"]:
"-DGRAPHITE2_STATIC", "-DGRAPHITE2_STATIC",
] ]
) )
env_harfbuzz.disable_warnings()
env_thirdparty = env_harfbuzz.Clone() lib = env_harfbuzz.add_library("harfbuzz_builtin", thirdparty_sources)
env_thirdparty.disable_warnings() thirdparty_obj += lib
lib = env_thirdparty.add_library("harfbuzz_builtin", thirdparty_sources)
# Needs to be appended to arrive after libscene in the linker call, # 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 # but we don't want it to arrive *after* system libs, so manual hack
@ -151,10 +155,11 @@ if env["builtin_harfbuzz"]:
if not inserted: if not inserted:
env.Append(LIBS=[lib]) env.Append(LIBS=[lib])
if env["builtin_graphite"]: if env["builtin_graphite"]:
env_graphite = env_modules.Clone() env_graphite = env_modules.Clone()
env_graphite.disable_warnings()
# Thirdparty source files
thirdparty_dir = "#thirdparty/graphite/" thirdparty_dir = "#thirdparty/graphite/"
thirdparty_sources = [ thirdparty_sources = [
"src/gr_char_info.cpp", "src/gr_char_info.cpp",
@ -203,10 +208,9 @@ if env["builtin_graphite"]:
"-DGRAPHITE2_NFILEFACE", "-DGRAPHITE2_NFILEFACE",
] ]
) )
env_graphite.disable_warnings()
env_thirdparty = env_graphite.Clone() lib = env_graphite.add_library("graphite_builtin", thirdparty_sources)
env_thirdparty.disable_warnings() thirdparty_obj += lib
lib = env_thirdparty.add_library("graphite_builtin", thirdparty_sources)
# Needs to be appended to arrive after libscene in the linker call, # 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 # but we don't want it to arrive *after* system libs, so manual hack
@ -221,12 +225,12 @@ if env["builtin_graphite"]:
if not inserted: if not inserted:
env.Append(LIBS=[lib]) env.Append(LIBS=[lib])
if env["builtin_icu"]: if env["builtin_icu"]:
env_icu = env_modules.Clone() env_icu = env_modules.Clone()
env_icu.disable_warnings()
# Thirdparty source files
thirdparty_dir = "#thirdparty/icu4c/" thirdparty_dir = "#thirdparty/icu4c/"
# Thirdparty source files
thirdparty_sources = [ thirdparty_sources = [
"common/appendable.cpp", "common/appendable.cpp",
"common/bmpset.cpp", "common/bmpset.cpp",
@ -457,10 +461,8 @@ if env["builtin_icu"]:
] ]
) )
env_icu.disable_warnings() lib = env_icu.add_library("icu_builtin", thirdparty_sources)
env_thirdparty = env_icu.Clone() thirdparty_obj += lib
env_thirdparty.disable_warnings()
lib = env_thirdparty.add_library("icu_builtin", thirdparty_sources)
# Needs to be appended to arrive after libscene in the linker call, # 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 # but we don't want it to arrive *after* system libs, so manual hack
@ -475,6 +477,11 @@ if env["builtin_icu"]:
if not inserted: if not inserted:
env.Append(LIBS=[lib]) env.Append(LIBS=[lib])
# Godot source files
module_obj = []
if env_text_server_adv["tools"]: if env_text_server_adv["tools"]:
env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"]) env_text_server_adv.Append(CXXFLAGS=["-DICU_STATIC_DATA"])
@ -486,4 +493,9 @@ env_text_server_adv.Append(
"#thirdparty/icu4c/common/", "#thirdparty/icu4c/common/",
] ]
) )
env_text_server_adv.add_source_files(env.modules_sources, "*.cpp")
env_text_server_adv.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -9,4 +9,5 @@ env_text_server_fb.Append(
"#thirdparty/freetype/include", "#thirdparty/freetype/include",
] ]
) )
env_text_server_fb.add_source_files(env.modules_sources, "*.cpp") env_text_server_fb.add_source_files(env.modules_sources, "*.cpp")

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_theora = env_modules.Clone() env_theora = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_libtheora"]: if env["builtin_libtheora"]:
thirdparty_dir = "#thirdparty/libtheora/" thirdparty_dir = "#thirdparty/libtheora/"
thirdparty_sources = [ thirdparty_sources = [
@ -80,7 +83,16 @@ if env["builtin_libtheora"]:
env_thirdparty = env_theora.Clone() env_thirdparty = env_theora.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_theora.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_theora.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_tinyexr = env_modules.Clone() env_tinyexr = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
# Not unbundled for now as they are not commonly available as shared library # Not unbundled for now as they are not commonly available as shared library
thirdparty_dir = "#thirdparty/tinyexr/" thirdparty_dir = "#thirdparty/tinyexr/"
thirdparty_sources = [ thirdparty_sources = [
@ -20,7 +23,15 @@ env_tinyexr.Append(CPPDEFINES=["TINYEXR_USE_THREAD"])
env_thirdparty = env_tinyexr.Clone() env_thirdparty = env_tinyexr.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot's own source files # Godot source files
env_tinyexr.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_tinyexr.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -7,6 +7,8 @@ env_upnp = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_miniupnpc"]: if env["builtin_miniupnpc"]:
thirdparty_dir = "#thirdparty/miniupnpc/" thirdparty_dir = "#thirdparty/miniupnpc/"
thirdparty_sources = [ thirdparty_sources = [
@ -31,7 +33,16 @@ if env["builtin_miniupnpc"]:
env_thirdparty = env_upnp.Clone() env_thirdparty = env_upnp.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_upnp.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_upnp.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -7,6 +7,8 @@ env_vhacd = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/vhacd/" thirdparty_dir = "#thirdparty/vhacd/"
thirdparty_sources = [ thirdparty_sources = [
@ -24,10 +26,19 @@ thirdparty_sources = [
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_vhacd.Prepend(CPPPATH=[thirdparty_dir + "/inc"]) env_vhacd.Prepend(CPPPATH=[thirdparty_dir + "inc"])
env_thirdparty = env_vhacd.Clone() env_thirdparty = env_vhacd.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
env_vhacd.add_source_files(env.modules_sources, "*.cpp") # Godot source files
module_obj = []
env_vhacd.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -8,9 +8,10 @@ Import("env_modules")
env_vorbis = env_modules.Clone() env_vorbis = env_modules.Clone()
stub = True
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_libvorbis"]: if env["builtin_libvorbis"]:
thirdparty_dir = "#thirdparty/libvorbis/" thirdparty_dir = "#thirdparty/libvorbis/"
thirdparty_sources = [ thirdparty_sources = [
@ -51,7 +52,16 @@ if env["builtin_libvorbis"]:
env_thirdparty = env_vorbis.Clone() env_thirdparty = env_vorbis.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Module files
env_vorbis.add_source_files(env.modules_sources, "register_types.cpp") # Godot source files
module_obj = []
env_vorbis.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_webm = env_modules.Clone() env_webm = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
thirdparty_dir = "#thirdparty/libsimplewebm/" thirdparty_dir = "#thirdparty/libsimplewebm/"
thirdparty_sources = [ thirdparty_sources = [
"libwebm/mkvparser/mkvparser.cc", "libwebm/mkvparser/mkvparser.cc",
@ -31,7 +34,15 @@ if env["builtin_libvpx"]:
env_thirdparty = env_webm.Clone() env_thirdparty = env_webm.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_webm.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_webm.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_webp = env_modules.Clone() env_webp = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_libwebp"]: if env["builtin_libwebp"]:
thirdparty_dir = "#thirdparty/libwebp/" thirdparty_dir = "#thirdparty/libwebp/"
thirdparty_sources = [ thirdparty_sources = [
@ -130,7 +133,16 @@ if env["builtin_libwebp"]:
env_thirdparty = env_webp.Clone() env_thirdparty = env_webp.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_webp.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_webp.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -3,8 +3,6 @@
Import("env") Import("env")
Import("env_modules") Import("env_modules")
# Thirdparty source files
env_webrtc = env_modules.Clone() env_webrtc = env_modules.Clone()
use_gdnative = env_webrtc["module_gdnative_enabled"] use_gdnative = env_webrtc["module_gdnative_enabled"]

View File

@ -5,28 +5,44 @@ Import("env_modules")
env_ws = env_modules.Clone() env_ws = env_modules.Clone()
thirdparty_obj = []
if env["platform"] == "javascript": if env["platform"] == "javascript":
# Our JavaScript/C++ interface. # Our JavaScript/C++ interface.
env.AddJSLibraries(["library_godot_websocket.js"]) env.AddJSLibraries(["library_godot_websocket.js"])
elif env["builtin_wslay"]: elif env["builtin_wslay"]:
# Thirdparty source files # Thirdparty source files
wslay_dir = "#thirdparty/wslay/" thirdparty_dir = "#thirdparty/wslay/"
wslay_sources = [ thirdparty_sources = [
"wslay_net.c", "wslay_net.c",
"wslay_event.c", "wslay_event.c",
"wslay_queue.c", "wslay_queue.c",
"wslay_stack.c", "wslay_stack.c",
"wslay_frame.c", "wslay_frame.c",
] ]
wslay_sources = [wslay_dir + s for s in wslay_sources] thirdparty_sources = [thirdparty_dir + s for s in thirdparty_sources]
env_ws.Prepend(CPPPATH=[wslay_dir + "includes/"])
env_ws.Prepend(CPPPATH=[thirdparty_dir + "includes/"])
env_ws.Append(CPPDEFINES=["HAVE_CONFIG_H"]) env_ws.Append(CPPDEFINES=["HAVE_CONFIG_H"])
if env["platform"] == "windows" or env["platform"] == "uwp": if env["platform"] == "windows" or env["platform"] == "uwp":
env_ws.Append(CPPDEFINES=["HAVE_WINSOCK2_H"]) env_ws.Append(CPPDEFINES=["HAVE_WINSOCK2_H"])
else: else:
env_ws.Append(CPPDEFINES=["HAVE_NETINET_IN_H"]) env_ws.Append(CPPDEFINES=["HAVE_NETINET_IN_H"])
env_wslay = env_ws.Clone()
env_wslay.disable_warnings()
env_wslay.add_source_files(env.modules_sources, wslay_sources)
env_ws.add_source_files(env.modules_sources, "*.cpp") env_thirdparty = env_ws.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files
module_obj = []
env_ws.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -6,6 +6,9 @@ Import("env_modules")
env_xatlas_unwrap = env_modules.Clone() env_xatlas_unwrap = env_modules.Clone()
# Thirdparty source files # Thirdparty source files
thirdparty_obj = []
if env["builtin_xatlas"]: if env["builtin_xatlas"]:
thirdparty_dir = "#thirdparty/xatlas/" thirdparty_dir = "#thirdparty/xatlas/"
thirdparty_sources = [ thirdparty_sources = [
@ -17,7 +20,16 @@ if env["builtin_xatlas"]:
env_thirdparty = env_xatlas_unwrap.Clone() env_thirdparty = env_xatlas_unwrap.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files # Godot source files
env_xatlas_unwrap.add_source_files(env.modules_sources, "*.cpp")
module_obj = []
env_xatlas_unwrap.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)

View File

@ -29,10 +29,14 @@ for x in android_files:
env_thirdparty = env_android.Clone() env_thirdparty = env_android.Clone()
env_thirdparty.disable_warnings() env_thirdparty.disable_warnings()
android_objects.append(env_thirdparty.SharedObject("#thirdparty/misc/ifaddrs-android.cc")) thirdparty_obj = env_thirdparty.SharedObject("#thirdparty/misc/ifaddrs-android.cc")
android_objects.append(thirdparty_obj)
lib = env_android.add_shared_library("#bin/libgodot", [android_objects], SHLIBSUFFIX=env["SHLIBSUFFIX"]) lib = env_android.add_shared_library("#bin/libgodot", [android_objects], SHLIBSUFFIX=env["SHLIBSUFFIX"])
# Needed to force rebuilding the platform files when the thirdparty code is updated.
env.Depends(lib, thirdparty_obj)
lib_arch_dir = "" lib_arch_dir = ""
if env["android_arch"] == "armv7": if env["android_arch"] == "armv7":
lib_arch_dir = "armeabi-v7a" lib_arch_dir = "armeabi-v7a"

View File

@ -4,24 +4,9 @@ Import("env")
env.scene_sources = [] env.scene_sources = []
# Thirdparty code # Godot source files
thirdparty_dir = "#thirdparty/misc/"
thirdparty_sources = [
# C++ sources
"easing_equations.cpp",
# C sources
"mikktspace.c",
]
thirdparty_sources = [thirdparty_dir + file for file in 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") env.add_source_files(env.scene_sources, "*.cpp")
# Chain load SCsubs # Chain load SCsubs
SConscript("main/SCsub") SConscript("main/SCsub")
SConscript("gui/SCsub") SConscript("gui/SCsub")
@ -32,7 +17,6 @@ SConscript("audio/SCsub")
SConscript("resources/SCsub") SConscript("resources/SCsub")
SConscript("debugger/SCsub") SConscript("debugger/SCsub")
# Build it all as a library # Build it all as a library
lib = env.add_library("scene", env.scene_sources) lib = env.add_library("scene", env.scene_sources)
env.Prepend(LIBS=[lib]) env.Prepend(LIBS=[lib])

View File

@ -2,4 +2,23 @@
Import("env") Import("env")
env.add_source_files(env.scene_sources, "*.cpp") # Thirdparty code
thirdparty_obj = []
thirdparty_sources = "#thirdparty/misc/easing_equations.cpp"
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.scene_sources += thirdparty_obj
# Godot source files
scene_obj = []
env.add_source_files(scene_obj, "*.cpp")
env.scene_sources += scene_obj
# Needed to force rebuilding the scene files when the thirdparty code is updated.
env.Depends(scene_obj, thirdparty_obj)

View File

@ -2,6 +2,25 @@
Import("env") Import("env")
env.add_source_files(env.scene_sources, "*.cpp") # Thirdparty code
thirdparty_obj = []
thirdparty_sources = "#thirdparty/misc/mikktspace.c"
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.scene_sources += thirdparty_obj
# Godot source files
scene_obj = []
env.add_source_files(scene_obj, "*.cpp")
env.scene_sources += scene_obj
# Needed to force rebuilding the scene files when the thirdparty code is updated.
env.Depends(scene_obj, thirdparty_obj)
SConscript("default_theme/SCsub") SConscript("default_theme/SCsub")

View File

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