Skip to content

Shared library support for C API#451

Open
santiberna wants to merge 9 commits into
BinomialLLC:masterfrom
santiberna:basisu-shared-c-api
Open

Shared library support for C API#451
santiberna wants to merge 9 commits into
BinomialLLC:masterfrom
santiberna:basisu-shared-c-api

Conversation

@santiberna
Copy link
Copy Markdown

This PR adds support for compiling basis universal as a shared object (.dll or .so). Only the C API (basisu_wasm_api.h and basis_wasm_transcoder_api.h) has been exposed.

Main changes:

  • CMake option BASISU_SHARED has been added to control compiling as a shared library.
  • The above option is disabled on wasm builds, as shared libraries aren't a thing there.
  • BASISU_API macro for exporting symbols, in new basisu_config.h file.

Currently, compiling the tool or example executables with this feature enabled fails since they require access to the full basisu API which is not exported (maybe we can disable compiling those targets or add a cmake warning when attempting this). It works perfectly for the C API example.

@santiberna santiberna force-pushed the basisu-shared-c-api branch from 555a4b3 to c137fde Compare May 5, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant