Skip to content

Commit ea089e3

Browse files
stemanngiordano
authored andcommitted
[Runner] Updated xcrun executable to handle --show-sdk-path and --show-sdk-version.
1 parent 36a94b7 commit ea089e3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Runner.jl

+10-2
Original file line numberDiff line numberDiff line change
@@ -1001,8 +1001,16 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
10011001
# <https://github.com/JuliaPackaging/Yggdrasil/pull/2962>.
10021002
xcrun_path = joinpath(bin_path, triplet(platform), "xcrun")
10031003
write(xcrun_path, """
1004-
#!/bin/sh
1005-
exec "\${@}"
1004+
#!/bin/bash
1005+
if [[ "\${@}" == *"--show-sdk-path"* ]]; then
1006+
echo /opt/$target/$target/sys-root
1007+
elif [[ "\${@}" == *"--show-sdk-version"* ]]; then
1008+
grep -A1 '<key>Version</key>' /opt/$target/$target/sys-root/SDKSettings.plist \
1009+
| tail -n1 \
1010+
| sed -E -e 's/\s*<string>([^<]+)<\/string>\s*/\1/'
1011+
else
1012+
exec "\${@}"
1013+
fi
10061014
""")
10071015
chmod(xcrun_path, 0o775)
10081016
end

0 commit comments

Comments
 (0)