Skip to content

Commit

Permalink
Error instead of a depwarn for string libnames
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Sep 3, 2023
1 parent 7e575cf commit 8085e0d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CxxWrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,12 @@ function wrapfunctions(jlmod)
wrap_functions(module_functions, jlmod)
end

__stringsoname_error(fname) = @error """Calling `@$fname` with the path of the library to load is no longer supported.
Pass the name of a function returning the path instead, e.g. use `libfoo_jll.get_libfoo_path` instead of `libfoo_jll.libfoo`."""

function readmodule(so_path::String, funcname, m::Module, flags)
Base.depwarn("Calling `@readmodule` with the path of the library to load is deprecated. Pass the name of a function returning the path instead, e.g. use `libfoo_jll.get_libfoo_path` instead of `libfoo_jll.libfoo`.", :readmodule; force=true)
readmodule(() -> so_path, funcname, m, flags)
__stringsoname_error("readmodule")
end

function readmodule(so_path_cb::Function, funcname, m::Module, flags)
Expand All @@ -750,8 +753,8 @@ function readmodule(so_path_cb::Function, funcname, m::Module, flags)
end

function wrapmodule(so_path::String, funcname, m::Module, flags)
Base.depwarn("Calling `@wrapmodule` with the path of the library to load is deprecated. Pass the name of a function returning the path instead, e.g. use `libfoo_jll.get_libfoo_path` instead of `libfoo_jll.libfoo`.", :wrapmodule; force=true)
wrapmodule(() -> so_path, funcname, m, flags)
__stringsoname_error("wrapmodule")
end

function wrapmodule(so_path_cb::Function, funcname, m::Module, flags)
Expand Down

0 comments on commit 8085e0d

Please sign in to comment.