From d52b70fb5e8e842ddcc9a57bad8e34366c0ee6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 30 Apr 2019 13:12:02 +0200 Subject: [PATCH] SCons: Always use env.Prepend for CPPPATH Include paths are processed from left to right, so we use Prepend to ensure that paths to bundled thirdparty files will have precedence over system paths (e.g. `/usr/include` should have lowest priority). --- SConstruct | 2 +- core/SCsub | 8 +++--- drivers/gl_context/SCsub | 2 +- drivers/png/SCsub | 4 +-- modules/assimp/SCsub | 26 ++++++++++---------- modules/bullet/SCsub | 2 +- modules/cvtt/SCsub | 2 +- modules/enet/SCsub | 2 +- modules/etc/SCsub | 2 +- modules/freetype/SCsub | 6 ++--- modules/gdnative/SCsub | 4 +-- modules/gdnative/videodecoder/SCsub | 2 +- modules/jpg/SCsub | 2 +- modules/mono/build_scripts/mono_configure.py | 4 +-- modules/ogg/SCsub | 2 +- modules/opensimplex/SCsub | 2 +- modules/opus/SCsub | 4 +-- modules/pvr/SCsub | 2 +- modules/recast/SCsub | 2 +- modules/regex/SCsub | 2 +- modules/squish/SCsub | 2 +- modules/svg/SCsub | 4 +-- modules/theora/SCsub | 6 ++--- modules/tinyexr/SCsub | 2 +- modules/upnp/SCsub | 2 +- modules/vhacd/SCsub | 2 +- modules/vorbis/SCsub | 4 +-- modules/webm/SCsub | 10 ++++---- modules/webm/libvpx/SCsub | 4 +-- modules/webp/SCsub | 2 +- modules/webrtc/SCsub | 3 +-- modules/websocket/SCsub | 6 ++--- modules/xatlas_unwrap/SCsub | 2 +- platform/android/detect.py | 2 +- platform/haiku/detect.py | 4 +-- platform/iphone/detect.py | 10 ++++---- platform/javascript/detect.py | 2 +- platform/osx/detect.py | 2 +- platform/server/detect.py | 4 +-- platform/uwp/detect.py | 4 +-- platform/windows/detect.py | 6 ++--- platform/x11/detect.py | 4 +-- 42 files changed, 84 insertions(+), 85 deletions(-) diff --git a/SConstruct b/SConstruct index e943f8dc04..f32924835d 100644 --- a/SConstruct +++ b/SConstruct @@ -189,7 +189,7 @@ Help(opts.GenerateHelpText(env_base)) # generate help # add default include paths -env_base.Append(CPPPATH=['#editor', '#']) +env_base.Prepend(CPPPATH=['#', '#editor']) # configure ENV for platform env_base.platform_exporters = platform_exporters diff --git a/core/SCsub b/core/SCsub index d5be74a64f..06efc8408d 100644 --- a/core/SCsub +++ b/core/SCsub @@ -80,9 +80,9 @@ if env['builtin_zlib']: ] thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources] - env_thirdparty.Append(CPPPATH=[thirdparty_zlib_dir]) + env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir]) # Needs to be available in main env too - env.Append(CPPPATH=[thirdparty_zlib_dir]) + env.Prepend(CPPPATH=[thirdparty_zlib_dir]) env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources) @@ -128,9 +128,9 @@ if env['builtin_zstd']: ] thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources] - env_thirdparty.Append(CPPPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"]) + env_thirdparty.Prepend(CPPPATH=[thirdparty_zstd_dir, thirdparty_zstd_dir + "common"]) env_thirdparty.Append(CPPFLAGS="-DZSTD_STATIC_LINKING_ONLY") - env.Append(CPPPATH=thirdparty_zstd_dir) + env.Prepend(CPPPATH=thirdparty_zstd_dir) # Also needed in main env includes will trigger warnings env.Append(CPPFLAGS="-DZSTD_STATIC_LINKING_ONLY") diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index efb26a7908..ef5b57a0cc 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -10,7 +10,7 @@ if (env["platform"] in ["haiku", "osx", "windows", "x11"]): ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env.Append(CPPPATH=[thirdparty_dir]) + env.Prepend(CPPPATH=[thirdparty_dir]) env.Append(CPPFLAGS=['-DGLAD_ENABLED']) env.Append(CPPFLAGS=['-DGLES_OVER_GL']) diff --git a/drivers/png/SCsub b/drivers/png/SCsub index 97ba1de3db..9dc80244ff 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -26,9 +26,9 @@ if env['builtin_libpng']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_png.Append(CPPPATH=[thirdparty_dir]) + env_png.Prepend(CPPPATH=[thirdparty_dir]) # Needed for drivers includes and in platform/javascript - env.Append(CPPPATH=[thirdparty_dir]) + env.Prepend(CPPPATH=[thirdparty_dir]) # Currently .ASM filter_neon.S does not compile on NT. import os diff --git a/modules/assimp/SCsub b/modules/assimp/SCsub index 61a357809a..0da7e432e2 100644 --- a/modules/assimp/SCsub +++ b/modules/assimp/SCsub @@ -4,19 +4,19 @@ Import('env') Import('env_modules') env_assimp = env_modules.Clone() -env_assimp.Append(CPPPATH=['#thirdparty/assimp']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/include']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/code/Importer/IFC']) -env_assimp.Append(CPPPATH=['#thirdparty/misc']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/code']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/irrXML/']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/unzip/']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/code/Importer/STEPParser']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/']) -env_assimp.Append(CPPPATH=['#thirdparty/zlib/']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/openddlparser/include']) -env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/rapidjson/include']) -env_assimp.Append(CPPPATH=['.']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/include']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/IFC']) +env_assimp.Prepend(CPPPATH=['#thirdparty/misc']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/irrXML/']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/unzip/']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/STEPParser']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/']) +env_assimp.Prepend(CPPPATH=['#thirdparty/zlib/']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/openddlparser/include']) +env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/rapidjson/include']) +env_assimp.Prepend(CPPPATH=['.']) #env_assimp.Append(CPPFLAGS=['-DASSIMP_DOUBLE_PRECISION']) # TODO default to what godot is compiled with for future double support env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_BOOST_WORKAROUND']) env_assimp.Append(CPPFLAGS=['-DOPENDDLPARSER_BUILD']) diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index e7c2fff54c..16d694c238 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -186,7 +186,7 @@ if env['builtin_bullet']: thirdparty_sources = [thirdparty_dir + file for file in bullet2_src] - env_bullet.Append(CPPPATH=[thirdparty_dir]) + env_bullet.Prepend(CPPPATH=[thirdparty_dir]) # if env['target'] == "debug" or env['target'] == "release_debug": # env_bullet.Append(CPPFLAGS=['-DBT_DEBUG']) diff --git a/modules/cvtt/SCsub b/modules/cvtt/SCsub index fcc69d8371..142af0c800 100644 --- a/modules/cvtt/SCsub +++ b/modules/cvtt/SCsub @@ -14,7 +14,7 @@ if env['builtin_squish']: thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_cvtt.Append(CPPPATH=[thirdparty_dir]) + env_cvtt.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_cvtt.Clone() env_thirdparty.disable_warnings() diff --git a/modules/enet/SCsub b/modules/enet/SCsub index a57a4b29ea..78d8d43414 100644 --- a/modules/enet/SCsub +++ b/modules/enet/SCsub @@ -21,7 +21,7 @@ if env['builtin_enet']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_enet.Append(CPPPATH=[thirdparty_dir]) + env_enet.Prepend(CPPPATH=[thirdparty_dir]) env_enet.Append(CPPFLAGS=["-DGODOT_ENET"]) env_thirdparty = env_enet.Clone() diff --git a/modules/etc/SCsub b/modules/etc/SCsub index eb2738053b..532b97b006 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -27,7 +27,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_etc.Append(CPPPATH=[thirdparty_dir]) +env_etc.Prepend(CPPPATH=[thirdparty_dir]) # upstream uses c++11 if not env.msvc: diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index f2cd9f9a60..0c8b223a9e 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -68,9 +68,9 @@ if env['builtin_freetype']: sfnt = env_freetype.Object(sfnt, CPPFLAGS=['-U__OPTIMIZE__']) thirdparty_sources += [sfnt] - env_freetype.Append(CPPPATH=[thirdparty_dir + "/include"]) + env_freetype.Prepend(CPPPATH=[thirdparty_dir + "/include"]) # Also needed in main env for scene/ - env.Append(CPPPATH=[thirdparty_dir + "/include"]) + env.Prepend(CPPPATH=[thirdparty_dir + "/include"]) env_freetype.Append(CPPFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG']) if (env['target'] != 'release'): @@ -78,7 +78,7 @@ if env['builtin_freetype']: # Also requires libpng headers if env['builtin_libpng']: - env_freetype.Append(CPPPATH=["#thirdparty/libpng"]) + env_freetype.Prepend(CPPPATH=["#thirdparty/libpng"]) env_thirdparty = env_freetype.Clone() env_thirdparty.disable_warnings() diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 235f0b97bb..0cdd585558 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -12,7 +12,7 @@ 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") -env_gdnative.Append(CPPPATH=['#modules/gdnative/include/']) +env_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/']) Export('env_gdnative') @@ -36,7 +36,7 @@ if ARGUMENTS.get('gdnative_wrapper', False): 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/']) + gd_wrapper_env.Prepend(CPPPATH=['#modules/gdnative/include/']) if gd_wrapper_env['use_lto']: if not env.msvc: diff --git a/modules/gdnative/videodecoder/SCsub b/modules/gdnative/videodecoder/SCsub index 8d9c1ff50e..04cc8ed604 100644 --- a/modules/gdnative/videodecoder/SCsub +++ b/modules/gdnative/videodecoder/SCsub @@ -5,5 +5,5 @@ Import('env_modules') env_vsdecoder_gdnative = env_modules.Clone() -env_vsdecoder_gdnative.Append(CPPPATH=['#modules/gdnative/include/']) +env_vsdecoder_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/']) env_vsdecoder_gdnative.add_source_files(env.modules_sources, '*.cpp') diff --git a/modules/jpg/SCsub b/modules/jpg/SCsub index d5f87905eb..96e8e704dd 100644 --- a/modules/jpg/SCsub +++ b/modules/jpg/SCsub @@ -13,7 +13,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_jpg.Append(CPPPATH=[thirdparty_dir]) +env_jpg.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_jpg.Clone() env_thirdparty.disable_warnings() diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py index 160580e116..4cfa2a5b93 100644 --- a/modules/mono/build_scripts/mono_configure.py +++ b/modules/mono/build_scripts/mono_configure.py @@ -70,7 +70,7 @@ def configure(env, env_mono): mono_lib_path = os.path.join(mono_root, 'lib') env.Append(LIBPATH=mono_lib_path) - env_mono.Append(CPPPATH=os.path.join(mono_root, 'include', 'mono-2.0')) + env_mono.Prepend(CPPPATH=os.path.join(mono_root, 'include', 'mono-2.0')) if mono_static: lib_suffix = Environment()['LIBSUFFIX'] @@ -153,7 +153,7 @@ def configure(env, env_mono): mono_lib_path = os.path.join(mono_root, 'lib') env.Append(LIBPATH=mono_lib_path) - env_mono.Append(CPPPATH=os.path.join(mono_root, 'include', 'mono-2.0')) + env_mono.Prepend(CPPPATH=os.path.join(mono_root, 'include', 'mono-2.0')) mono_lib = find_file_in_dir(mono_lib_path, mono_lib_names, prefix='lib', extension='.a') diff --git a/modules/ogg/SCsub b/modules/ogg/SCsub index 765a9fc11a..6a72a519fe 100644 --- a/modules/ogg/SCsub +++ b/modules/ogg/SCsub @@ -14,7 +14,7 @@ if env['builtin_libogg']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_ogg.Append(CPPPATH=[thirdparty_dir]) + env_ogg.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_ogg.Clone() env_thirdparty.disable_warnings() diff --git a/modules/opensimplex/SCsub b/modules/opensimplex/SCsub index 4235f6a0b9..311d33b047 100644 --- a/modules/opensimplex/SCsub +++ b/modules/opensimplex/SCsub @@ -12,7 +12,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_opensimplex.Append(CPPPATH=[thirdparty_dir]) +env_opensimplex.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_opensimplex.Clone() env_thirdparty.disable_warnings() diff --git a/modules/opus/SCsub b/modules/opus/SCsub index a1325734e2..f3c981dd45 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -206,7 +206,7 @@ if env['builtin_opus']: # also requires libogg if env['builtin_libogg']: - env_opus.Append(CPPPATH=["#thirdparty/libogg"]) + env_opus.Prepend(CPPPATH=["#thirdparty/libogg"]) env_opus.Append(CPPFLAGS=["-DHAVE_CONFIG_H"]) @@ -218,7 +218,7 @@ if env['builtin_opus']: "silk/fixed", "silk/float", ] - env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) + env_opus.Prepend(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths]) if env["platform"] == "android": if ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]): diff --git a/modules/pvr/SCsub b/modules/pvr/SCsub index 2e4a792a36..18da38fbbd 100644 --- a/modules/pvr/SCsub +++ b/modules/pvr/SCsub @@ -17,7 +17,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_pvr.Append(CPPPATH=[thirdparty_dir]) +env_pvr.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_pvr.Clone() env_thirdparty.disable_warnings() diff --git a/modules/recast/SCsub b/modules/recast/SCsub index 4a06653968..94d9968164 100644 --- a/modules/recast/SCsub +++ b/modules/recast/SCsub @@ -23,7 +23,7 @@ if env['builtin_recast']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_recast.Append(CPPPATH=[thirdparty_dir + "/Include"]) + env_recast.Prepend(CPPPATH=[thirdparty_dir + "/Include"]) env_thirdparty = env_recast.Clone() env_thirdparty.disable_warnings() diff --git a/modules/regex/SCsub b/modules/regex/SCsub index 99c25add45..65f354ffa7 100644 --- a/modules/regex/SCsub +++ b/modules/regex/SCsub @@ -46,7 +46,7 @@ if env['builtin_pcre2']: thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_regex.Append(CPPPATH=[thirdparty_dir]) + env_regex.Prepend(CPPPATH=[thirdparty_dir]) env_regex.Append(CPPFLAGS=thirdparty_flags) def pcre2_builtin(width): diff --git a/modules/squish/SCsub b/modules/squish/SCsub index 3be85a1efa..15320bcd0c 100644 --- a/modules/squish/SCsub +++ b/modules/squish/SCsub @@ -22,7 +22,7 @@ if env['builtin_squish']: thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_squish.Append(CPPPATH=[thirdparty_dir]) + env_squish.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_squish.Clone() env_thirdparty.disable_warnings() diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 66d9b3bf75..90bfe22abb 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -12,10 +12,10 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_svg.Append(CPPPATH=[thirdparty_dir]) +env_svg.Prepend(CPPPATH=[thirdparty_dir]) # FIXME: Needed in editor/editor_themes.cpp for now, but ideally there # shouldn't be a dependency on modules/ and its own 3rd party deps. -env.Append(CPPPATH=[thirdparty_dir]) +env.Prepend(CPPPATH=[thirdparty_dir]) env.Append(CPPFLAGS=["-DSVG_ENABLED"]) env_thirdparty = env_svg.Clone() diff --git a/modules/theora/SCsub b/modules/theora/SCsub index f98db2359c..785eca4c41 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -70,13 +70,13 @@ if env['builtin_libtheora']: thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_theora.Append(CPPPATH=[thirdparty_dir]) + env_theora.Prepend(CPPPATH=[thirdparty_dir]) # also requires libogg and libvorbis if env['builtin_libogg']: - env_theora.Append(CPPPATH=["#thirdparty/libogg"]) + env_theora.Prepend(CPPPATH=["#thirdparty/libogg"]) if env['builtin_libvorbis']: - env_theora.Append(CPPPATH=["#thirdparty/libvorbis"]) + env_theora.Prepend(CPPPATH=["#thirdparty/libvorbis"]) env_thirdparty = env_theora.Clone() env_thirdparty.disable_warnings() diff --git a/modules/tinyexr/SCsub b/modules/tinyexr/SCsub index 3e7bda2bca..97f9797b58 100644 --- a/modules/tinyexr/SCsub +++ b/modules/tinyexr/SCsub @@ -13,7 +13,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_tinyexr.Append(CPPPATH=[thirdparty_dir]) +env_tinyexr.Prepend(CPPPATH=[thirdparty_dir]) env_thirdparty = env_tinyexr.Clone() env_thirdparty.disable_warnings() diff --git a/modules/upnp/SCsub b/modules/upnp/SCsub index 2b15f7aee2..6d669ab73b 100644 --- a/modules/upnp/SCsub +++ b/modules/upnp/SCsub @@ -25,7 +25,7 @@ if env['builtin_miniupnpc']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_upnp.Append(CPPPATH=[thirdparty_dir]) + env_upnp.Prepend(CPPPATH=[thirdparty_dir]) env_upnp.Append(CPPFLAGS=["-DMINIUPNP_STATICLIB"]) env_thirdparty = env_upnp.Clone() diff --git a/modules/vhacd/SCsub b/modules/vhacd/SCsub index fdd3ddc1e6..161aed2eb9 100644 --- a/modules/vhacd/SCsub +++ b/modules/vhacd/SCsub @@ -24,7 +24,7 @@ thirdparty_sources = [ thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_vhacd.Append(CPPPATH=[thirdparty_dir+"/inc"]) +env_vhacd.Prepend(CPPPATH=[thirdparty_dir + "/inc"]) env_vhacd.Append(CPPFLAGS=["-DGODOT_ENET"]) # upstream uses c++11 diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub index 19587563ab..3824fdd789 100644 --- a/modules/vorbis/SCsub +++ b/modules/vorbis/SCsub @@ -40,11 +40,11 @@ if env['builtin_libvorbis']: thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_vorbis.Append(CPPPATH=[thirdparty_dir]) + env_vorbis.Prepend(CPPPATH=[thirdparty_dir]) # also requires libogg if env['builtin_libogg']: - env_vorbis.Append(CPPPATH=["#thirdparty/libogg"]) + env_vorbis.Prepend(CPPPATH=["#thirdparty/libogg"]) env_thirdparty = env_vorbis.Clone() env_thirdparty.disable_warnings() diff --git a/modules/webm/SCsub b/modules/webm/SCsub index dcc9a45044..e57437229f 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -15,7 +15,7 @@ thirdparty_sources = [ ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] -env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"]) +env_webm.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"]) # upstream uses c++11 if (not env_webm.msvc): @@ -23,14 +23,14 @@ if (not env_webm.msvc): # also requires libogg, libvorbis and libopus if env['builtin_libogg']: - env_webm.Append(CPPPATH=["#thirdparty/libogg"]) + env_webm.Prepend(CPPPATH=["#thirdparty/libogg"]) if env['builtin_libvorbis']: - env_webm.Append(CPPPATH=["#thirdparty/libvorbis"]) + env_webm.Prepend(CPPPATH=["#thirdparty/libvorbis"]) if env['builtin_opus']: - env_webm.Append(CPPPATH=["#thirdparty/opus"]) + env_webm.Prepend(CPPPATH=["#thirdparty/opus"]) if env['builtin_libvpx']: - env_webm.Append(CPPPATH=["#thirdparty/libvpx"]) + env_webm.Prepend(CPPPATH=["#thirdparty/libvpx"]) SConscript("libvpx/SCsub") env_thirdparty = env_webm.Clone() diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 5bf4ea3464..a6be1380a6 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -256,7 +256,7 @@ libvpx_sources_arm_neon_gas_apple = [libvpx_dir + file for file in libvpx_source env_libvpx = env_modules.Clone() env_libvpx.disable_warnings() -env_libvpx.Append(CPPPATH=[libvpx_dir]) +env_libvpx.Prepend(CPPPATH=[libvpx_dir]) webm_multithread = env["platform"] != 'javascript' @@ -380,7 +380,7 @@ if webm_cpu_x86: elif webm_cpu_arm: env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm) if env["platform"] == 'android': - env_libvpx.Append(CPPPATH=[libvpx_dir + "third_party/android"]) + env_libvpx.Prepend(CPPPATH=[libvpx_dir + "third_party/android"]) env_libvpx.add_source_files(env.modules_sources, [libvpx_dir + "third_party/android/cpu-features.c"]) env_libvpx_neon = env_libvpx.Clone() diff --git a/modules/webp/SCsub b/modules/webp/SCsub index fa3896c457..666628bb44 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -126,7 +126,7 @@ if env['builtin_libwebp']: ] thirdparty_sources = [thirdparty_dir + "src/" + file for file in thirdparty_sources] - env_webp.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "src/"]) + env_webp.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "src/"]) env_thirdparty = env_webp.Clone() env_thirdparty.disable_warnings() diff --git a/modules/webrtc/SCsub b/modules/webrtc/SCsub index 446bd530c2..868553b879 100644 --- a/modules/webrtc/SCsub +++ b/modules/webrtc/SCsub @@ -10,7 +10,6 @@ use_gdnative = env_webrtc["module_gdnative_enabled"] if use_gdnative: # GDNative is retained in Javascript for export compatibility env_webrtc.Append(CPPDEFINES=['WEBRTC_GDNATIVE_ENABLED']) - gdnative_includes = ["#modules/gdnative/include/"] - env_webrtc.Append(CPPPATH=gdnative_includes) + env_webrtc.Prepend(CPPPATH=["#modules/gdnative/include/"]) env_webrtc.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index 12b4969cf7..2d2de81220 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -75,7 +75,7 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea else: # Unix socket thirdparty_sources += Glob(thirdparty_dir + "lib/plat/unix/*.c") - env_lws.Append(CPPPATH=[thirdparty_dir + 'include/']) + env_lws.Prepend(CPPPATH=[thirdparty_dir + 'include/']) if env['builtin_mbedtls']: mbedtls_includes = "#thirdparty/mbedtls/include" @@ -85,14 +85,14 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea env_lws.Prepend(CPPPATH=wrapper_includes) if env["platform"] == "windows" or env["platform"] == "uwp": - env_lws.Append(CPPPATH=[helper_dir]) + env_lws.Prepend(CPPPATH=[helper_dir]) if env["platform"] == "uwp": env_lws.Append(CPPFLAGS=["/DLWS_MINGW_SUPPORT"]) env_thirdparty = env_lws.Clone() env_thirdparty.disable_warnings() - env_thirdparty.Append(CPPPATH=[thirdparty_dir + 'lib/']) + env_thirdparty.Prepend(CPPPATH=[thirdparty_dir + 'lib/']) env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) env_lws.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/xatlas_unwrap/SCsub b/modules/xatlas_unwrap/SCsub index 7a40945f27..50e3cb1551 100644 --- a/modules/xatlas_unwrap/SCsub +++ b/modules/xatlas_unwrap/SCsub @@ -13,7 +13,7 @@ if env['builtin_xatlas']: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_xatlas_unwrap.Append(CPPPATH=[thirdparty_dir]) + env_xatlas_unwrap.Prepend(CPPPATH=[thirdparty_dir]) # upstream uses c++11 if (not env.msvc): diff --git a/platform/android/detect.py b/platform/android/detect.py index 6c67067db7..8d35617d20 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -299,7 +299,7 @@ def configure(env): env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + '/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib']) - env.Append(CPPPATH=['#platform/android']) + env.Prepend(CPPPATH=['#platform/android']) env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL']) env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl']) diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index 874b1ab1fb..f33c77a407 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -137,7 +137,7 @@ def configure(env): if not env['builtin_miniupnpc']: # No pkgconfig file so far, hardcode default paths. - env.Append(CPPPATH=["/system/develop/headers/x86/miniupnpc"]) + env.Prepend(CPPPATH=["/system/develop/headers/x86/miniupnpc"]) env.Append(LIBS=["miniupnpc"]) # On Linux wchar_t should be 32-bits @@ -147,7 +147,7 @@ def configure(env): ## Flags - env.Append(CPPPATH=['#platform/haiku']) + env.Prepend(CPPPATH=['#platform/haiku']) env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED']) env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED']) # env.Append(CPPFLAGS=['-DFREETYPE_ENABLED']) diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index d56e28a4af..3ed0a4ade7 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -165,12 +165,12 @@ def configure(env): if env['icloud']: env.Append(CPPFLAGS=['-DICLOUD_ENABLED']) - env.Append(CPPPATH=['$IPHONESDK/usr/include', - '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', - '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers', - ]) + env.Prepend(CPPPATH=['$IPHONESDK/usr/include', + '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', + '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers', + ]) env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' - env.Append(CPPPATH=['#platform/iphone']) + env.Prepend(CPPPATH=['#platform/iphone']) env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DCOREAUDIO_ENABLED']) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index c7acbde3f7..145ce8d83d 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -103,7 +103,7 @@ def configure(env): ## Compile flags - env.Append(CPPPATH=['#platform/javascript']) + env.Prepend(CPPPATH=['#platform/javascript']) env.Append(CPPDEFINES=['JAVASCRIPT_ENABLED', 'UNIX_ENABLED']) # No multi-threading (SharedArrayBuffer) available yet, diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 8024897195..4c88f91d13 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -126,7 +126,7 @@ def configure(env): ## Flags - env.Append(CPPPATH=['#platform/osx']) + env.Prepend(CPPPATH=['#platform/osx']) env.Append(CPPFLAGS=['-DOSX_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DAPPLE_STYLE_KEYS', '-DCOREAUDIO_ENABLED', '-DCOREMIDI_ENABLED']) env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'CoreVideo']) env.Append(LIBS=['pthread']) diff --git a/platform/server/detect.py b/platform/server/detect.py index 5306a2bf69..08c2eb6aaf 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -201,7 +201,7 @@ def configure(env): if not env['builtin_miniupnpc']: # No pkgconfig file so far, hardcode default paths. - env.Append(CPPPATH=["/usr/include/miniupnpc"]) + env.Prepend(CPPPATH=["/usr/include/miniupnpc"]) env.Append(LIBS=["miniupnpc"]) # On Linux wchar_t should be 32-bits @@ -215,7 +215,7 @@ def configure(env): if not env['builtin_zlib']: env.ParseConfig('pkg-config zlib --cflags --libs') - env.Append(CPPPATH=['#platform/server']) + env.Prepend(CPPPATH=['#platform/server']) env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED']) if (platform.system() == "Darwin"): diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index 17f8242466..00f419f4f0 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -77,7 +77,7 @@ def configure(env): # ANGLE angle_root = os.getenv("ANGLE_SRC_PATH") - env.Append(CPPPATH=[angle_root + '/include']) + env.Prepend(CPPPATH=[angle_root + '/include']) jobs = str(env.GetOption("num_jobs")) angle_build_cmd = "msbuild.exe " + angle_root + "/winrt/10/src/angle.sln /nologo /v:m /m:" + jobs + " /p:Configuration=Release /p:Platform=" @@ -137,7 +137,7 @@ def configure(env): ## Compile flags - env.Append(CPPPATH=['#platform/uwp', '#drivers/windows']) + env.Prepend(CPPPATH=['#platform/uwp', '#drivers/windows']) env.Append(CPPFLAGS=['/DUWP_ENABLED', '/DWINDOWS_ENABLED', '/DTYPED_METHOD_BIND']) env.Append(CPPFLAGS=['/DGLES_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED']) winver = "0x0602" # Windows 8 is the minimum target for UWP build diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 5c38eebf04..4b4b507499 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -201,7 +201,7 @@ def configure_msvc(env, manual_msvc_config): env.AppendUnique(CXXFLAGS=['/TP']) # assume all sources are C++ if manual_msvc_config: # should be automatic if SCons found it if os.getenv("WindowsSdkDir") is not None: - env.Append(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"]) + env.Prepend(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"]) else: print("Missing environment variable: WindowsSdkDir") @@ -239,7 +239,7 @@ def configure_msvc(env, manual_msvc_config): env.AppendUnique(LINKFLAGS=['/LTCG']) if manual_msvc_config: - env.Append(CPPPATH=[p for p in os.getenv("INCLUDE").split(";")]) + env.Prepend(CPPPATH=[p for p in os.getenv("INCLUDE").split(";")]) env.Append(LIBPATH=[p for p in os.getenv("LIB").split(";")]) # Incremental linking fix @@ -342,7 +342,7 @@ def configure_mingw(env): def configure(env): # At this point the env has been set up with basic tools/compilers. - env.Append(CPPPATH=['#platform/windows']) + env.Prepend(CPPPATH=['#platform/windows']) print("Configuring for Windows: target=%s, bits=%s" % (env['target'], env['bits'])) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index f8ae5e9acb..933ee6b72e 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -275,7 +275,7 @@ def configure(env): if not env['builtin_miniupnpc']: # No pkgconfig file so far, hardcode default paths. - env.Append(CPPPATH=["/usr/include/miniupnpc"]) + env.Prepend(CPPPATH=["/usr/include/miniupnpc"]) env.Append(LIBS=["miniupnpc"]) # On Linux wchar_t should be 32-bits @@ -316,7 +316,7 @@ def configure(env): if not env['builtin_zlib']: env.ParseConfig('pkg-config zlib --cflags --libs') - env.Append(CPPPATH=['#platform/x11']) + env.Prepend(CPPPATH=['#platform/x11']) env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED']) env.Append(LIBS=['GL', 'pthread'])