Merge pull request #113029 from akien-mga/2.1-build-fixes

[2.1] More build fixes
This commit is contained in:
Rémi Verschelde 2025-11-26 21:51:42 +01:00 committed by GitHub
commit 162340457c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 19 additions and 12 deletions

View file

@ -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 = []

View file

@ -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")

View file

@ -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)

View file

@ -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),
]

View file

@ -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)

View file

@ -23,7 +23,7 @@ def get_opts():
return [
('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),
('separate_debug_symbols', 'Extract debug symbols in .dSYM archive', False),
]

View file

@ -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