summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-28 14:45:27 +0200
committerGitHub <noreply@github.com>2018-09-28 14:45:27 +0200
commitd8af4f9e02277194ca1bb053447a25bfed2b6524 (patch)
treec33aa8ccee82b26d868fbc91abed94e2480864c2 /modules
parent243bdc4524ddcf8ac6bef03c378e14fe7bb263b8 (diff)
parent3a2ca68af3c8bafe9f60f09bd8fece894fe3a925 (diff)
Merge pull request #22506 from akien-mga/thirdparty-no-warnings
SCons: Build thirdparty code in own env, disable warnings
Diffstat (limited to 'modules')
-rw-r--r--modules/SCsub2
-rw-r--r--modules/bullet/SCsub6
-rw-r--r--modules/cvtt/SCsub5
-rw-r--r--modules/enet/SCsub5
-rw-r--r--modules/etc/SCsub16
-rw-r--r--modules/freetype/SCsub2
-rw-r--r--modules/gdnative/SCsub29
-rw-r--r--modules/gdnative/arvr/SCsub11
-rw-r--r--modules/gdnative/nativescript/SCsub8
-rw-r--r--modules/gdnative/net/SCsub9
-rw-r--r--modules/gdnative/pluginscript/SCsub7
-rw-r--r--modules/gdscript/SCsub2
-rw-r--r--modules/gridmap/SCsub2
-rw-r--r--modules/jpg/SCsub5
-rwxr-xr-xmodules/mbedtls/SCsub6
-rw-r--r--modules/mobile_vr/SCsub3
-rw-r--r--modules/mobile_vr/shaders/SCsub1
-rw-r--r--modules/ogg/SCsub5
-rw-r--r--modules/opensimplex/SCsub20
-rw-r--r--modules/opus/SCsub12
-rw-r--r--modules/pvr/SCsub5
-rw-r--r--modules/recast/SCsub7
-rw-r--r--modules/regex/SCsub17
-rw-r--r--modules/squish/SCsub5
-rw-r--r--modules/svg/SCsub7
-rw-r--r--modules/thekla_unwrap/SCsub13
-rw-r--r--modules/theora/SCsub5
-rw-r--r--modules/tinyexr/SCsub5
-rw-r--r--modules/upnp/SCsub6
-rw-r--r--modules/visual_script/SCsub2
-rw-r--r--modules/vorbis/SCsub5
-rw-r--r--modules/webm/SCsub15
-rw-r--r--modules/webm/libvpx/SCsub13
-rw-r--r--modules/webp/SCsub5
-rw-r--r--modules/websocket/SCsub35
35 files changed, 179 insertions, 122 deletions
diff --git a/modules/SCsub b/modules/SCsub
index 74a5267355..67f5893db4 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -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])
diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub
index 2557e8cb1d..11ce18449b 100644
--- a/modules/bullet/SCsub
+++ b/modules/bullet/SCsub
@@ -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")
diff --git a/modules/cvtt/SCsub b/modules/cvtt/SCsub
index 5c396482aa..fcc69d8371 100644
--- a/modules/cvtt/SCsub
+++ b/modules/cvtt/SCsub
@@ -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")
diff --git a/modules/enet/SCsub b/modules/enet/SCsub
index 7caeafa1d6..a57a4b29ea 100644
--- a/modules/enet/SCsub
+++ b/modules/enet/SCsub
@@ -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")
diff --git a/modules/etc/SCsub b/modules/etc/SCsub
index 31d8f00ef3..d2c77d6e3c 100644
--- a/modules/etc/SCsub
+++ b/modules/etc/SCsub
@@ -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")
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index c86e78ccee..d2f0ad042a 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -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
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
index 46b2a832f1..fe2d8c7ce9 100644
--- a/modules/gdnative/SCsub
+++ b/modules/gdnative/SCsub
@@ -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/'])
diff --git a/modules/gdnative/arvr/SCsub b/modules/gdnative/arvr/SCsub
index ecc5996108..20eaa99592 100644
--- a/modules/gdnative/arvr/SCsub
+++ b/modules/gdnative/arvr/SCsub
@@ -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')
diff --git a/modules/gdnative/nativescript/SCsub b/modules/gdnative/nativescript/SCsub
index ee3b9c351d..5841ad5531 100644
--- a/modules/gdnative/nativescript/SCsub
+++ b/modules/gdnative/nativescript/SCsub
@@ -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')
diff --git a/modules/gdnative/net/SCsub b/modules/gdnative/net/SCsub
index 53f9271128..e915703935 100644
--- a/modules/gdnative/net/SCsub
+++ b/modules/gdnative/net/SCsub
@@ -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')
diff --git a/modules/gdnative/pluginscript/SCsub b/modules/gdnative/pluginscript/SCsub
index 2031a4236b..20eaa99592 100644
--- a/modules/gdnative/pluginscript/SCsub
+++ b/modules/gdnative/pluginscript/SCsub
@@ -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')
diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub
index 73f09f1659..6904154953 100644
--- a/modules/gdscript/SCsub
+++ b/modules/gdscript/SCsub
@@ -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')
diff --git a/modules/gridmap/SCsub b/modules/gridmap/SCsub
index 2ffe15cd33..62b8a0ff93 100644
--- a/modules/gridmap/SCsub
+++ b/modules/gridmap/SCsub
@@ -6,5 +6,3 @@ Import('env_modules')
env_gridmap = env_modules.Clone()
env_gridmap.add_source_files(env.modules_sources, "*.cpp")
-
-Export('env')
diff --git a/modules/jpg/SCsub b/modules/jpg/SCsub
index e72dc6a1ca..d5f87905eb 100644
--- a/modules/jpg/SCsub
+++ b/modules/jpg/SCsub
@@ -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")
diff --git a/modules/mbedtls/SCsub b/modules/mbedtls/SCsub
index d11d7a7ec7..0c6c703e16 100755
--- a/modules/mbedtls/SCsub
+++ b/modules/mbedtls/SCsub
@@ -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")
diff --git a/modules/mobile_vr/SCsub b/modules/mobile_vr/SCsub
index b4e2edcca1..e5725ceb6f 100644
--- a/modules/mobile_vr/SCsub
+++ b/modules/mobile_vr/SCsub
@@ -1,8 +1,5 @@
#!/usr/bin/env python
-import os
-import methods
-
Import('env')
Import('env_modules')
diff --git a/modules/mobile_vr/shaders/SCsub b/modules/mobile_vr/shaders/SCsub
index cf53c9ebe0..97a3598598 100644
--- a/modules/mobile_vr/shaders/SCsub
+++ b/modules/mobile_vr/shaders/SCsub
@@ -4,4 +4,3 @@ Import('env')
if 'GLES3_GLSL' in env['BUILDERS']:
env.GLES3_GLSL('lens_distorted.glsl');
-
diff --git a/modules/ogg/SCsub b/modules/ogg/SCsub
index 5e559bd4db..765a9fc11a 100644
--- a/modules/ogg/SCsub
+++ b/modules/ogg/SCsub
@@ -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")
diff --git a/modules/opensimplex/SCsub b/modules/opensimplex/SCsub
index e6b2f41162..4235f6a0b9 100644
--- a/modules/opensimplex/SCsub
+++ b/modules/opensimplex/SCsub
@@ -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")
diff --git a/modules/opus/SCsub b/modules/opus/SCsub
index 6f643ef08c..508aec7057 100644
--- a/modules/opus/SCsub
+++ b/modules/opus/SCsub
@@ -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
diff --git a/modules/pvr/SCsub b/modules/pvr/SCsub
index ddca7a794e..2e4a792a36 100644
--- a/modules/pvr/SCsub
+++ b/modules/pvr/SCsub
@@ -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")
diff --git a/modules/recast/SCsub b/modules/recast/SCsub
index f56be72b24..4a06653968 100644
--- a/modules/recast/SCsub
+++ b/modules/recast/SCsub
@@ -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')
diff --git a/modules/regex/SCsub b/modules/regex/SCsub
index 4b8d5e9283..99c25add45 100644
--- a/modules/regex/SCsub
+++ b/modules/regex/SCsub
@@ -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")
diff --git a/modules/squish/SCsub b/modules/squish/SCsub
index 127f22d798..3be85a1efa 100644
--- a/modules/squish/SCsub
+++ b/modules/squish/SCsub
@@ -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")
diff --git a/modules/svg/SCsub b/modules/svg/SCsub
index a41e0703bd..d14191056f 100644
--- a/modules/svg/SCsub
+++ b/modules/svg/SCsub
@@ -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')
diff --git a/modules/thekla_unwrap/SCsub b/modules/thekla_unwrap/SCsub
index d23ba10d4c..8a04b50907 100644
--- a/modules/thekla_unwrap/SCsub
+++ b/modules/thekla_unwrap/SCsub
@@ -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")
diff --git a/modules/theora/SCsub b/modules/theora/SCsub
index 9015c2c354..98c4274a7e 100644
--- a/modules/theora/SCsub
+++ b/modules/theora/SCsub
@@ -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")
diff --git a/modules/tinyexr/SCsub b/modules/tinyexr/SCsub
index 38fd00cc65..3e7bda2bca 100644
--- a/modules/tinyexr/SCsub
+++ b/modules/tinyexr/SCsub
@@ -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")
diff --git a/modules/upnp/SCsub b/modules/upnp/SCsub
index cde231867f..2b15f7aee2 100644
--- a/modules/upnp/SCsub
+++ b/modules/upnp/SCsub
@@ -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")
diff --git a/modules/visual_script/SCsub b/modules/visual_script/SCsub
index 96ee911ba0..3c3d2caa57 100644
--- a/modules/visual_script/SCsub
+++ b/modules/visual_script/SCsub
@@ -6,5 +6,3 @@ Import('env_modules')
env_vs = env_modules.Clone()
env_vs.add_source_files(env.modules_sources, "*.cpp")
-
-Export('env')
diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub
index 55a112585b..19587563ab 100644
--- a/modules/vorbis/SCsub
+++ b/modules/vorbis/SCsub
@@ -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")
diff --git a/modules/webm/SCsub b/modules/webm/SCsub
index 33561da098..cb35b926ab 100644
--- a/modules/webm/SCsub
+++ b/modules/webm/SCsub
@@ -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")
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index 711000bd9f..98e38b9027 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -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'
diff --git a/modules/webp/SCsub b/modules/webp/SCsub
index 21ae0ce7c2..8a4307fbe1 100644
--- a/modules/webp/SCsub
+++ b/modules/webp/SCsub
@@ -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")
diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub
index c0985b3245..b67a836fe8 100644
--- a/modules/websocket/SCsub
+++ b/modules/websocket/SCsub
@@ -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])
+
+ 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)
+ 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["platform"] == "windows" or env["platform"] == "uwp":
+ env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir])
- if env_lws["platform"] == "windows" or env_lws["platform"] == "uwp":
- env_lws.Append(CPPPATH=[thirdparty_dir + helper_dir])
+ if env["platform"] == "uwp":
+ env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"])
- if env_lws["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")