@@ -64,10 +64,10 @@ rule.
6464 exclude_docstrings = False ,
6565 recursive = False ):
6666
67- It generates a `py_binary <https://bazel.build/reference/be/
68- python#py_binary> `__ rule with a corresponding runfiles distribution,
69- which invokes nanobind's builtin stubgen script, outputs a stub file and,
70- optionally, a typing marker file into ``output_directory `` (defaults to
67+ It generates a `py_binary <https://bazel.build/reference/be/python#py_binary >`__
68+ rule with a corresponding runfiles distribution, which invokes nanobind's
69+ builtin stubgen script, outputs a stub file and, optionally,
70+ a typing marker file into ``output_directory `` (defaults to
7171 the build output directory, commonly called "bindir" in Bazel terms).
7272
7373 All arguments (except the name, which is used only to refer to the target
@@ -115,12 +115,35 @@ To build a C++ shared library with nanobind as a dependency, use the
115115 ** kwargs ):
116116
117117 It corresponds directly to the builtin
118- `cc_shared_library <https://bazel.build/reference/be/
119- c-cpp#cc_shared_library> `__ rule, with all keyword arguments being directly
120- forwarded to a ``cc_shared_library `` target.
118+ `cc_shared_library <https://bazel.build/reference/be/c-cpp#cc_shared_library >`__
119+ rule, with all keyword arguments being directly forwarded to a
120+ ``cc_shared_library `` target.
121121
122122 *New in nanobind-bazel version 2.1.0. *
123123
124+ To build a C++ static library containing nanobind, use the
125+ ``nanobind_static_library `` rule.
126+
127+ .. py :function :: nanobind_static_library
128+
129+ Declares a Bazel target representing a static library (or archive) containing
130+ nanobind.
131+
132+ .. code-block :: python
133+
134+ def nanobind_static_library (name , deps , ** kwargs ):
135+
136+ It corresponds directly to the builtin
137+ `cc_static_library <https://bazel.build/reference/be/c-cpp#cc_static_library >`__
138+ rule, with all keyword arguments being directly
139+ forwarded to a ``cc_static_library `` target.
140+
141+ NB: This macro requires Bazel 7.4.0 or greater to use, as well as setting the
142+ ``--experimental_cc_static_library `` flag for the build, since the
143+ ``cc_static_library `` rule is considered experimental.
144+
145+ *New in nanobind-bazel version 2.7.0. *
146+
124147To build a C++ test target requiring nanobind, use the ``nanobind_test `` rule.
125148
126149.. py :function :: nanobind_test
@@ -157,6 +180,6 @@ following flag settings.
157180.. py :function :: @ nanobind_bazel// :py- limited- api (string)
158181
159182 Build nanobind extensions against the stable ABI of the configured Python
160- version. Allowed values are ``"cp312" ``, ``"cp313" ``, which target the
161- stable ABI starting from Python 3.12 or 3.13, respectively. By default, all
162- extensions are built without any ABI limitations.
183+ version. Allowed values are ``"cp312" ``, ``"cp313" ``, and `` "cp314" ``, which
184+ target the stable ABI starting from CPython 3.12, 3.13, or 3.14 respectively.
185+ By default, all extensions are built without any ABI limitations.
0 commit comments