Skip to content

Commit a405d41

Browse files
committed
Also automatically detect macOS version and SDK
1 parent 5930d05 commit a405d41

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

base/loading.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,9 +1784,13 @@ function ld()
17841784
elseif Sys.isapple()
17851785
flavor = "darwin"
17861786
arch = Sys.ARCH == :aarch64 ? :arm64 : Sys.ARCH
1787-
# TODO: gently handle failure in `xcrun` (command not found, garbage being returned, etc...)
1787+
# TODO: gently handle failure in `xcrun`/`sw_vers` (command not found, garbage being
1788+
# returned, etc...). We probably also want to provide ways to override platform
1789+
# version and SDK, for when we build the release binaries.
17881790
sysroot = readchomp(`xcrun --sdk macosx --show-sdk-path`)
1789-
default_args = `-arch $arch -syslibroot $(sysroot) -lSystem -platform_version macos 10 11`
1791+
platform_version = readchomp(`sw_vers -productVersion`)
1792+
platform_sdk = readchomp(`xcrun --show-sdk-version`)
1793+
default_args = `-arch $arch -syslibroot $(sysroot) -lSystem -platform_version macos $(platform_version) $(platform_sdk)`
17901794
else
17911795
flavor = "gnu"
17921796
end

0 commit comments

Comments
 (0)