@@ -74,7 +74,6 @@ This method generates the toplevel definitions common to all JLL packages, such
7474`is_available()`, the `PATH` and `LIBPATH` symbols, etc....
7575"""
7676function generate_toplevel_definitions (src_name, __source__)
77- pkg_dir = dirname (String (__source__. file))
7877 return quote
7978 """
8079 is_available()
@@ -120,6 +119,12 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
120119 # Load Artifacts.toml file and select best platform at compile-time, since this is
121120 # running at toplevel, and therefore will be run completely at compile-time. We use
122121 # a `let` block here to avoid storing unnecessary data in our `.ji` files
122+
123+ if @isdefined (augment_platform!)
124+ const host_platform = augment_platform! (HostPlatform ())
125+ else
126+ const host_platform = nothing
127+ end
123128 best_wrapper = let
124129 artifacts_toml = joinpath ($ (pkg_dir), " .." , " Artifacts.toml" )
125130 valid_wrappers = Dict {Platform,String} ()
@@ -158,13 +163,17 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
158163 end
159164
160165 # From the available options, choose the best wrapper script
161- select_platform (valid_wrappers)
166+ if host_platform != = nothing
167+ select_platform (valid_wrappers, host_platform)
168+ else
169+ select_platform (valid_wrappers)
170+ end
162171 end
163172 end
164173
165174 # Load in the wrapper, if it's not `nothing`!
166175 if best_wrapper === nothing
167- @debug (string (" Unable to load " , $ (src_name), " ; unsupported platform " , triplet (HostPlatform () )))
176+ @debug (string (" Unable to load " , $ (src_name), " ; unsupported platform " , triplet (host_platform )))
168177 is_available () = false
169178 else
170179 Base. include ($ (Symbol (" $(src_name) _jll" )), best_wrapper)
0 commit comments