Skip to content

Commit

Permalink
[Runner] Updated xcrun executable to handle --show-sdk-path and `--…
Browse files Browse the repository at this point in the history
…show-sdk-version`.
  • Loading branch information
stemann authored Dec 1, 2024
1 parent ac68310 commit 423856c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,16 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
# <https://github.com/JuliaPackaging/Yggdrasil/pull/2962>.
xcrun_path = joinpath(bin_path, triplet(platform), "xcrun")
write(xcrun_path, """
#!/bin/sh
exec "\${@}"
#!/bin/bash
if [[ "\${@}" == *"--show-sdk-path"* ]]; then
echo /opt/$target/$target/sys-root
elif [[ "\${@}" == *"--show-sdk-version"* ]]; then
grep -A1 '<key>Version</key>' /opt/$target/$target/sys-root/SDKSettings.plist \
| tail -n1 \
| sed -E -e 's/\s*<string>([^<]+)<\/string>\s*/\1/'
else
exec "\${@}"
fi
""")
chmod(xcrun_path, 0o775)
end
Expand Down

0 comments on commit 423856c

Please sign in to comment.