From da09c6131bcdace7e8e62c3dabc62890e9564c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 13 Oct 2016 18:54:00 +0200 Subject: 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__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. --- modules/jpg/SCsub | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'modules/jpg') diff --git a/modules/jpg/SCsub b/modules/jpg/SCsub index 409a8b52d0..258fd2f4ad 100644 --- a/modules/jpg/SCsub +++ b/modules/jpg/SCsub @@ -1,19 +1,18 @@ Import('env') Import('env_modules') +env_jpg = env_modules.Clone() + # Thirdparty source files # Not unbundled for now as they are not commonly available as shared library thirdparty_dir = "#thirdparty/jpeg-compressor/" -thirdparty_jpg_sources = [ +thirdparty_sources = [ "jpgd.cpp", ] -thirdparty_jpg_sources = [thirdparty_dir + file for file in thirdparty_jpg_sources] +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_modules.add_source_files(env.modules_sources, thirdparty_jpg_sources) -env_modules.Append(CPPPATH = [thirdparty_dir]) +env_jpg.add_source_files(env.modules_sources, thirdparty_sources) +env_jpg.Append(CPPPATH = [thirdparty_dir]) # Godot's own source files -env_modules.add_source_files(env.modules_sources, "*.cpp") - -Export('env_modules') -Export('env') +env_jpg.add_source_files(env.modules_sources, "*.cpp") -- cgit v1.2.3