Skip to content

Commit

Permalink
Also automatically detect macOS version and SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored and vchuravy committed Oct 19, 2022
1 parent eb503c2 commit 743b061
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1784,9 +1784,13 @@ function ld()
elseif Sys.isapple()
flavor = "darwin"
arch = Sys.ARCH == :aarch64 ? :arm64 : Sys.ARCH
# TODO: gently handle failure in `xcrun` (command not found, garbage being returned, etc...)
# TODO: gently handle failure in `xcrun`/`sw_vers` (command not found, garbage being
# returned, etc...). We probably also want to provide ways to override platform
# version and SDK, for when we build the release binaries.
sysroot = readchomp(`xcrun --sdk macosx --show-sdk-path`)
default_args = `-arch $arch -syslibroot $(sysroot) -lSystem -platform_version macos 10 11`
platform_version = readchomp(`sw_vers -productVersion`)
platform_sdk = readchomp(`xcrun --show-sdk-version`)
default_args = `-arch $arch -syslibroot $(sysroot) -lSystem -platform_version macos $(platform_version) $(platform_sdk)`
else
flavor = "gnu"
end
Expand Down

0 comments on commit 743b061

Please sign in to comment.