Skip to content

Commit

Permalink
Add type assertion to global accesses (JuliaPackaging#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity authored and contra-bit committed Jul 10, 2024
1 parent db5475e commit 11da912
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/products/executable_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ macro init_executable_product(product_name, product_path)
end

# Add this executable's directory onto the list of PATH's that we'll need to expose to dependents
push!(PATH_list, dirname($(path_name)))
push!(PATH_list, dirname($(path_name)::String))
end)
end
8 changes: 4 additions & 4 deletions src/products/library_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ macro declare_library_product(product_name, product_soname)
)
end

function init_new_library_product(product_name)
function init_new_library_product(product_name, path_name)
@static if VERSION < v"1.6.0-DEV"
return nothing
else
return quote
# Initialize non-const variable export with the path to this product
global $(product_name) = $(Symbol(string(product_name, "_path")))
global $(product_name) = $(path_name)::String
end
end
end
Expand All @@ -64,9 +64,9 @@ macro init_library_product(product_name, product_path, dlopen_flags)
JLLWrappers.musl_soname_workaround,
dlopen($(path_name), $(dlopen_flags))
)
push!(LIBPATH_list, dirname($(path_name)))
push!(LIBPATH_list, dirname($(path_name)::String))
end
end,
init_new_library_product(product_name),
init_new_library_product(product_name, path_name),
)
end

0 comments on commit 11da912

Please sign in to comment.