Skip to content

Commit 9c65de5

Browse files
committed
Support augment_platform in JLLWrappers
1 parent dd045e0 commit 9c65de5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/toplevel_generators.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ function generate_imports(src_name)
3131
using Pkg.Artifacts: load_artifacts_toml, unpack_platform
3232
using Pkg.BinaryPlatforms: triplet, select_platform
3333
HostPlatform() = platform_key_abi()
34+
if !@isdefined(augment_platform)
35+
augment_platform(platform) = platform
36+
end
3437
end
3538
else
3639
# Use fast stdlib-based Artifacts + Preferences
3740
return quote
3841
using Libdl, Artifacts, JLLWrappers.Preferences, Base.BinaryPlatforms
3942
using Artifacts: load_artifacts_toml, unpack_platform
4043
using Base.BinaryPlatforms: triplet, select_platform
44+
if !@isdefined(augment_platform)
45+
augment_platform(platform) = platform
46+
end
4147
end
4248
end
4349
end
@@ -158,13 +164,15 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
158164
end
159165

160166
# From the available options, choose the best wrapper script
161-
select_platform(valid_wrappers)
167+
platform = augment_platform(HostPlatform())
168+
select_platform(valid_wrappers, platform)
162169
end
163170
end
164171

165172
# Load in the wrapper, if it's not `nothing`!
166173
if best_wrapper === nothing
167-
@debug(string("Unable to load ", $(src_name), "; unsupported platform ", triplet(HostPlatform())))
174+
platform = augment_platform(HostPlatform())
175+
@debug(string("Unable to load ", $(src_name), "; unsupported platform ", repr(platform)))
168176
is_available() = false
169177
else
170178
Base.include($(Symbol("$(src_name)_jll")), best_wrapper)

0 commit comments

Comments
 (0)