Improve failed exports logic (#789)

This commit is contained in:
Keith Smiley 2021-09-21 17:35:40 -07:00 committed by GitHub
parent 7da37f815b
commit 6c0c2af3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -292,8 +292,11 @@ def get_env_prelude(ctx, lib_name, data_dependencies, target_root):
sdk = "{}{}".format(platform.lower(), version)
env_snippet.extend([
# TODO: This path needs to take cc_env["XCODE_VERSION_OVERRIDE"] into account
"export DEVELOPER_DIR=\"$(xcode-select --print-path)\"",
"export SDKROOT=\"$(xcrun --sdk {} --show-sdk-path)\"".format(sdk),
# Declare and export separately so bash doesn't ignore failures from the commands https://github.com/koalaman/shellcheck/wiki/SC2155
"developer_dir_tmp=\"$(xcode-select --print-path)\"",
"export DEVELOPER_DIR=\"$developer_dir_tmp\"",
"sdkroot_tmp=\"$(xcrun --sdk {} --show-sdk-path)\"".format(sdk),
"export SDKROOT=\"$sdkroot_tmp\"",
])
cc_toolchain = find_cpp_toolchain(ctx)