@@ -106,6 +106,37 @@ function ld_library_path(target::AbstractPlatform,
106
106
return join (paths, " :" )
107
107
end
108
108
109
+ function macos_version (kernel_version:: Integer )
110
+ # See https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
111
+ kernel_to_macos = Dict (
112
+ 12 => " 10.8" ,
113
+ 13 => " 10.9" ,
114
+ 14 => " 10.10" ,
115
+ 15 => " 10.11" ,
116
+ 16 => " 10.12" ,
117
+ 17 => " 10.13" ,
118
+ 18 => " 10.14" ,
119
+ 19 => " 10.15" ,
120
+ 20 => " 11.0" ,
121
+ 21 => " 12.0" ,
122
+ )
123
+ return get (kernel_to_macos, kernel_version, nothing )
124
+ end
125
+ function macos_version (p:: AbstractPlatform )
126
+ if os (p) != " macos"
127
+ return nothing
128
+ end
129
+
130
+ # If no `os_version` is specified in `p`, default to the oldest we support in the Julia world,
131
+ # which is `10.8`, but if it is actually specified, then set that corresponding value.
132
+ # version = something(os_version(p), v"14.0.0")
133
+
134
+ # Eventually, we'll take this in `os_version(p)`, but not just yet. We need to fix the paths
135
+ # to the compiler shards first, since right now they have `14` at the end
136
+ version = something (os_version (p), v " 14.0.0" )
137
+ return macos_version (version. major)
138
+ end
139
+
109
140
"""
110
141
generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::AbstractString,
111
142
host_platform::AbstractPlatform = $(repr (default_host_platform)) ,
@@ -295,37 +326,6 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
295
326
return flags
296
327
end
297
328
298
- function macos_version (kernel_version:: Integer )
299
- # See https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
300
- kernel_to_macos = Dict (
301
- 12 => " 10.8" ,
302
- 13 => " 10.9" ,
303
- 14 => " 10.10" ,
304
- 15 => " 10.11" ,
305
- 16 => " 10.12" ,
306
- 17 => " 10.13" ,
307
- 18 => " 10.14" ,
308
- 19 => " 10.15" ,
309
- 20 => " 11.0" ,
310
- 21 => " 12.0" ,
311
- )
312
- return get (kernel_to_macos, kernel_version, nothing )
313
- end
314
- function macos_version (p:: AbstractPlatform )
315
- if os (p) != " macos"
316
- return nothing
317
- end
318
-
319
- # If no `os_version` is specified in `p`, default to the oldest we support in the Julia world,
320
- # which is `10.8`, but if it is actually specified, then set that corresponding value.
321
- # version = something(os_version(p), v"14.0.0")
322
-
323
- # Eventually, we'll take this in `os_version(p)`, but not just yet. We need to fix the paths
324
- # to the compiler shards first, since right now they have `14` at the end
325
- version = something (os_version (p), v " 14.0.0" )
326
- return macos_version (version. major)
327
- end
328
-
329
329
function min_macos_version_flag (p:: AbstractPlatform )
330
330
# Ask compilers to compile for a minimum macOS version
331
331
return " -mmacosx-version-min=$(macos_version (p)) "
@@ -1076,7 +1076,7 @@ function platform_envs(platform::AbstractPlatform, src_name::AbstractString;
1076
1076
# If we're on macOS, we give a hint to things like `configure` that they should use this as the linker
1077
1077
if Sys. isapple (platform)
1078
1078
mapping[" LD" ] = " /opt/bin/$(triplet (platform)) /ld"
1079
- mapping[" MACOSX_DEPLOYMENT_TARGET" ] = " 10.8 "
1079
+ mapping[" MACOSX_DEPLOYMENT_TARGET" ] = macos_version (platform)
1080
1080
end
1081
1081
1082
1082
# There is no broad agreement on what host compilers should be called,
0 commit comments