JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

Make provisioning of custom init files to `create_library` more flexible #844

Closed sloede closed 11 months ago

sloede commented 11 months ago

Would it be acceptable to create a PR that effectively allows to pass a vector of files for julia_init_c_file? My motivation is that I want to provide my library with custom init/finalization functions that should internally call init_julia and shutdown_julia, thus I would like to call create_library as something like

create_library(package_dir, dest_dir; julia_init_c_file = [PackageCompiler.DEFAULT_JULIA_INIT, "my_init.c"])

At the same time, it would also make sense (I guess) to provide a julia_init_h_file kwargs to create_library that defaults to String(DEFAULT_JULIA_INIT_HEADER) but that could also be overridden in a similar fashion (with either a single header or a vector).