Closed ghost closed 1 year ago
This should be supported now with the latest nightly build
(once it finishes CI/CD, it's cold so might take an hour or two for the nightly release to be updated)
The easiest way to create a dynamic library is by adding
pragma dylib my_library_init my_library_deinit
to the top of your root file, as well as define the externally visible initialization and deinitialization functions:
external func my_library_init(){
print("Initialize called")
}
external func my_library_deinit(){
print("Deinitialize called")
}
And then all regular Adept features should be supported, including initialization/deinitialization of global variables and static variables.
See https://github.com/AdeptLanguage/Adept/tree/master/tests/e2e/src/dylib for full example
Originally posted by @IsaacShelton in https://github.com/AdeptLanguage/Adept/discussions/76#discussioncomment-6898564