Skip to content

Commit

Permalink
Support augment_platform in JLLWrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Dec 16, 2021
1 parent dd045e0 commit 9c65de5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/toplevel_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ function generate_imports(src_name)
using Pkg.Artifacts: load_artifacts_toml, unpack_platform
using Pkg.BinaryPlatforms: triplet, select_platform
HostPlatform() = platform_key_abi()
if !@isdefined(augment_platform)
augment_platform(platform) = platform
end
end
else
# Use fast stdlib-based Artifacts + Preferences
return quote
using Libdl, Artifacts, JLLWrappers.Preferences, Base.BinaryPlatforms
using Artifacts: load_artifacts_toml, unpack_platform
using Base.BinaryPlatforms: triplet, select_platform
if !@isdefined(augment_platform)
augment_platform(platform) = platform
end
end
end
end
Expand Down Expand Up @@ -158,13 +164,15 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
end

# From the available options, choose the best wrapper script
select_platform(valid_wrappers)
platform = augment_platform(HostPlatform())
select_platform(valid_wrappers, platform)
end
end

# Load in the wrapper, if it's not `nothing`!
if best_wrapper === nothing
@debug(string("Unable to load ", $(src_name), "; unsupported platform ", triplet(HostPlatform())))
platform = augment_platform(HostPlatform())
@debug(string("Unable to load ", $(src_name), "; unsupported platform ", repr(platform)))
is_available() = false
else
Base.include($(Symbol("$(src_name)_jll")), best_wrapper)
Expand Down

0 comments on commit 9c65de5

Please sign in to comment.