summaryrefslogtreecommitdiff
path: root/modules/vorbis
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-10-13 18:54:00 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-10-15 11:50:41 +0200
commitda09c6131bcdace7e8e62c3dabc62890e9564c97 (patch)
treee279b0e14a93ff546ab5eb427eeb1c65c9befe6a /modules/vorbis
parent422196759f93df249db38619f136cabd5dcf42cd (diff)
modules: Clone env in each module
This allows to pass include paths and flags only to a given thirdparty library, thus preventing conflicts between their files (e.g. between opus and openssl which both provide modes.h. This also has the nice effect of making the compilation command smaller for each module as it no longer related to all other modules, only the final linking brings them together. This however requires adding manually the ogg include path in opus and vorbis when building against the builtin ogg, since it is no longer in the global env. Also simplified template 'thirdparty_<module>_sources' to 'thirdparty_sources'. "Core" modules like cscript, gdscript, gridmap, ik and virtual_script still use the main env_modules, but it could be changed if need be.
Diffstat (limited to 'modules/vorbis')
-rw-r--r--modules/vorbis/SCsub19
1 files changed, 11 insertions, 8 deletions
diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub
index 5427348c39..f3dbc893fc 100644
--- a/modules/vorbis/SCsub
+++ b/modules/vorbis/SCsub
@@ -1,10 +1,12 @@
Import('env')
Import('env_modules')
+env_vorbis = env_modules.Clone()
+
# Thirdparty source files
if (env["libvorbis"] != "system"): # builtin
thirdparty_dir = "#thirdparty/libvorbis/"
- thirdparty_libvorbis_sources = [
+ thirdparty_sources = [
#"analysis.c",
#"barkmel.c",
"bitrate.c",
@@ -32,13 +34,14 @@ if (env["libvorbis"] != "system"): # builtin
"window.c",
]
- thirdparty_libvorbis_sources = [thirdparty_dir + file for file in thirdparty_libvorbis_sources]
+ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
- env_modules.add_source_files(env.modules_sources, thirdparty_libvorbis_sources)
- env_modules.Append(CPPPATH = [thirdparty_dir])
+ env_vorbis.add_source_files(env.modules_sources, thirdparty_sources)
+ env_vorbis.Append(CPPPATH = [thirdparty_dir])
-# Godot source files
-env_modules.add_source_files(env.modules_sources, "*.cpp")
+ # also requires libogg
+ if (env["libogg"] != "system"): # builtin
+ env_vorbis.Append(CPPPATH = ["#thirdparty/libogg"])
-Export('env_modules')
-Export('env')
+# Godot source files
+env_vorbis.add_source_files(env.modules_sources, "*.cpp")