# Autogenerated wrapper script for assimp_win_jll for x86_64-w64-mingw32-cxx03
export assimp

using Zlib_jll
## Global variables
PATH = ""
LIBPATH = ""
LIBPATH_env = "PATH"
LIBPATH_default = ""

# Relative path to `assimp`
const assimp_splitpath = ["bin", "libassimp.dll"]

# This will be filled out by __init__() for all products, as it must be done at runtime
assimp_path = ""

# assimp-specific global declaration
# This will be filled out by __init__()
assimp_handle = C_NULL

# This must be `const` so that we can use it with `ccall()`
const assimp = "libassimp.dll"


# Initialize PATH and LIBPATH environment variable listings.
# From the list of our dependencies, generate a tuple of all the PATH and LIBPATH lists,
# then append them to our own.
foreach(p -> append!(PATH_list, p), (Zlib_jll.PATH_list,))
foreach(p -> append!(LIBPATH_list, p), (Zlib_jll.LIBPATH_list,))
# Inform that the wrapper is available for this platform
is_available() = true

"""
Open all libraries
"""
function __init__()
    global artifact_dir = abspath(artifact"assimp_win")

    global PATH_list, LIBPATH_list
    global assimp_path = normpath(joinpath(artifact_dir, assimp_splitpath...))

    # Manually `dlopen()` this right now so that future invocations
    # of `ccall` with its `SONAME` will find this path immediately.
    global assimp_handle = dlopen(assimp_path)
    push!(LIBPATH_list, dirname(assimp_path))

    # Filter out duplicate and empty entries in our PATH and LIBPATH entries
    filter!(!isempty, unique!(PATH_list))
    filter!(!isempty, unique!(LIBPATH_list))
    global PATH = join(PATH_list, ';')
    global LIBPATH = join(vcat(LIBPATH_list, [Sys.BINDIR, joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)]), ';')

    
end  # __init__()
