From d53d5af6b898573c266198019570e29fde168b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 7 Mar 2021 22:27:14 +0100 Subject: [PATCH 1/4] SCons: Fix parsing PATH when constructing base environment We constructed the SCons environment without taking any (shell) environment variables into account, and then appended a few, but too late. This would cause variables like `env[CXX]` not to be properly expanded to respect a non-standard `PATH`. We now use `PrependENVPath` to ensure this works. With this fix, setting: ``` PATH=$GODOT_SDK/bin:$PATH ``` will now properly use `$GODOT_SDK/bin/gcc` if available over `/usr/bin/gcc`. (cherry picked from commits 5d217a94414117438d92b094956baead8ec942fb and 04312419358421d07753c4238cf95c8edec436be) --- SConstruct | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index e3c7d2498b1..b5a4ae4ff65 100644 --- a/SConstruct +++ b/SConstruct @@ -65,11 +65,15 @@ elif (os.name == "nt"): if (os.getenv("VCINSTALLDIR") == None or platform_arg == "android" or platform_arg == "javascript"): custom_tools = ['mingw'] +# We let SCons build its default ENV as it includes OS-specific things which we don't +# want to have to pull in manually. +# Then we prepend PATH to make it take precedence, while preserving SCons' own entries. env_base = Environment(tools=custom_tools) -if 'TERM' in os.environ: - env_base['ENV']['TERM'] = os.environ['TERM'] -env_base.AppendENVPath('PATH', os.getenv('PATH')) -env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH')) +env_base.PrependENVPath("PATH", os.getenv("PATH")) +env_base.PrependENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH")) +if "TERM" in os.environ: # Used for colored output. + env_base["ENV"]["TERM"] = os.environ["TERM"] + env_base.global_defaults = global_defaults env_base.android_maven_repos = [] env_base.android_flat_dirs = [] From 83e2c6dd6d22067c5da9717eee8508261433017f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 21 Nov 2025 23:41:36 +0100 Subject: [PATCH 2/4] GL context: Define `GLEW_NO_GLU` to remove an unused dependency --- drivers/gl_context/SCsub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index a968c10cfd8..8be5481d6ed 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -15,7 +15,7 @@ if (env["platform"] in ["haiku", "osx", "windows", "x11"]): env.Append(CPPFLAGS=['-DGLEW_STATIC']) env.Append(CPPPATH=[thirdparty_dir]) - env.Append(CPPFLAGS=['-DGLEW_ENABLED']) + env.Append(CPPFLAGS=['-DGLEW_ENABLED', '-DGLEW_NO_GLU']) # Godot source files env.add_source_files(env.drivers_sources, "*.cpp") From 1ddcab6312e03c0690180db3ca151a24112935c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 23 Nov 2025 00:34:28 +0100 Subject: [PATCH 3/4] Linux: Don't hardcode i386 lib paths when cross-compiling, unnecessary --- platform/x11/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 0dfbca11f8b..ec3771e360f 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -239,10 +239,10 @@ def configure(env): if (is64 and env["bits"] == "32"): env.Append(CPPFLAGS=['-m32']) - env.Append(LINKFLAGS=['-m32', '-L/usr/lib/i386-linux-gnu']) + env.Append(LINKFLAGS=['-m32']) elif (not is64 and env["bits"] == "64"): env.Append(CPPFLAGS=['-m64']) - env.Append(LINKFLAGS=['-m64', '-L/usr/lib/i686-linux-gnu']) + env.Append(LINKFLAGS=['-m64']) import methods From afd73a43a7b4b711dfd0d73d8c9160336158e06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 23 Nov 2025 12:15:53 +0100 Subject: [PATCH 4/4] OSX/iOS: Make .dSYM extraction opt-in --- platform/iphone/SCsub | 6 ++++-- platform/iphone/detect.py | 3 ++- platform/osx/SCsub | 2 +- platform/osx/detect.py | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index ee2cca61070..24d37a10bef 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -33,5 +33,7 @@ obj = env_ios.Object('godot_iphone.cpp') prog = None prog = env_ios.add_program('#bin/godot', [obj] + iphone_lib) -action = "$IPHONEPATH/usr/bin/dsymutil " + File(prog)[0].path + " -o " + File(prog)[0].path + ".dSYM" -env.AddPostAction(prog, action) + +if env['separate_debug_symbols']: + action = "$IPHONEPATH/usr/bin/dsymutil " + File(prog)[0].path + " -o " + File(prog)[0].path + ".dSYM" + env.AddPostAction(prog, action) diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 9256ef12652..fb85a8d1dc8 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -32,7 +32,8 @@ def get_opts(): ('ios_exceptions', 'Enable exceptions', 'no'), ('ios_triple', 'Triple for ios toolchain', ''), ('ios_sim', 'Build simulator binary', 'no'), - ('use_lto', 'Use link time optimization', 'no') + ('use_lto', 'Use link time optimization', 'no'), + ('separate_debug_symbols', 'Extract debug symbols in .dSYM archive', False), ] diff --git a/platform/osx/SCsub b/platform/osx/SCsub index 7cad5ac772e..76517b147bc 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -15,7 +15,7 @@ files = [ prog = env.add_program('#bin/godot', files) -if (env['target'] == "debug" or env['target'] == "release_debug"): +if env['separate_debug_symbols'] and (env['target'] == "debug" or env['target'] == "release_debug"): # Build the .dSYM file for atos action = "dsymutil " + File(prog)[0].path + " -o " + File(prog)[0].path + ".dSYM" env.AddPostAction(prog, action) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 20d313809e8..858f4664eac 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -23,7 +23,7 @@ def get_opts(): return [ ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'), - + ('separate_debug_symbols', 'Extract debug symbols in .dSYM archive', False), ]