mirror of
https://github.com/godotengine/godot
synced 2024-11-02 15:48:41 +00:00
da09c6131b
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.
19 lines
499 B
Text
19 lines
499 B
Text
Import('env')
|
|
Import('env_modules')
|
|
|
|
env_ogg = env_modules.Clone()
|
|
|
|
# Thirdparty source files
|
|
if (env["libogg"] != "system"): # builtin
|
|
thirdparty_dir = "#thirdparty/libogg/"
|
|
thirdparty_sources = [
|
|
"bitwise.c",
|
|
"framing.c",
|
|
]
|
|
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])
|
|
|
|
# Godot source files
|
|
env_ogg.add_source_files(env.modules_sources, "*.cpp")
|