mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #21339 from Placinta/master
Fix regular macOS build by passing -isysroot to compiler so correct system headers are found
This commit is contained in:
commit
a2a5793e13
3 changed files with 35 additions and 4 deletions
24
methods.py
24
methods.py
|
@ -628,3 +628,27 @@ def CommandNoCache(env, target, sources, command, **args):
|
|||
result = env.Command(target, sources, command, **args)
|
||||
env.NoCache(result)
|
||||
return result
|
||||
|
||||
def detect_darwin_sdk_path(platform, env):
|
||||
sdk_name = ''
|
||||
if platform == 'osx':
|
||||
sdk_name = 'macosx'
|
||||
var_name = 'MACOS_SDK_PATH'
|
||||
elif platform == 'iphone':
|
||||
sdk_name = 'iphoneos'
|
||||
var_name = 'IPHONESDK'
|
||||
elif platform == 'iphonesimulator':
|
||||
sdk_name = 'iphonesimulator'
|
||||
var_name = 'IPHONESDK'
|
||||
else:
|
||||
raise Exception("Invalid platform argument passed to detect_darwin_sdk_path")
|
||||
|
||||
if not env[var_name]:
|
||||
try:
|
||||
sdk_path = subprocess.check_output(['xcrun', '--sdk', sdk_name, '--show-sdk-path']).strip()
|
||||
if sdk_path:
|
||||
env[var_name] = sdk_path
|
||||
except (subprocess.CalledProcessError, OSError) as e:
|
||||
print("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
|
||||
raise
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue