Skip to content

Commit d328654

Browse files
committed
hoist expr
1 parent 6df3154 commit d328654

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/wrapper_generators.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ include("products/library_generators.jl")
44

55
macro generate_wrapper_header(src_name)
66
pkg_dir = dirname(dirname(String(__source__.file)))
7+
if VERSION >= v"1.6"
8+
artifact_expr = Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform))
9+
else
10+
artifact_expr = Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name)
11+
end
712
return esc(quote
813
function find_artifact_dir()
914
# We determine at compile-time whether our JLL package has been dev'ed and overridden
@@ -12,11 +17,7 @@ macro generate_wrapper_header(src_name)
1217
else
1318
# We explicitly use `macrocall` here so that we can manually pass the `__source__`
1419
# argument, to avoid `@artifact_str` trying to lookup `Artifacts.toml` here.
15-
if VERSION >= v"1.6"
16-
return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform)))
17-
else
18-
return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name))
19-
end
20+
return $(artifact_expr)
2021
end
2122
end
2223
end)

0 commit comments

Comments
 (0)