Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type assertion to global accesses #63

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/products/executable_generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,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
10 changes: 5 additions & 5 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 @@ -60,10 +60,10 @@ macro init_library_product(product_name, product_path, dlopen_flags)
# of `ccall` with its path/SONAME will find this path immediately.
# dlopen_flags === nothing means to not dlopen the library.
if $(dlopen_flags) !== nothing
global $(handle_name) = dlopen($(path_name), $(dlopen_flags))
push!(LIBPATH_list, dirname($(path_name)))
global $(handle_name) = dlopen($(path_name)::String, $(dlopen_flags))
push!(LIBPATH_list, dirname($(path_name)::String))
end
end,
init_new_library_product(product_name),
init_new_library_product(product_name, path_name),
)
end
Loading