nicholasjng / nanobind-bazel

Bazel defs and rules for building Python projects with nanobind extensions.
Apache License 2.0
6 stars 0 forks source link

Add nanobind's NB_DOMAIN option to nanobind-bazel #15

Closed nicholasjng closed 6 months ago

nicholasjng commented 6 months ago

This option sets a suffix after the libnanobind name for a shared nanobind library, I think like libnanobind-$NB_DOMAIN.so.

If it only affects the lib name, it could even work with a domain argument on a build rule. If it also affects visibility conditions, then it will probably have to work another way.

nicholasjng commented 6 months ago

@wjakob a quick GitHub search on NB_DOMAIN reveals that the NB_DOMAIN needs to be given at nanobind compile time, and is passed to nb::detail::init().

This means that I would need to set -DNB_DOMAIN="mydomain" in the nanobind build, right? How would I build several shielded extensions side by side in this scenario? Or is one domain per project enough?