benchmark/bindings/python/nanobind.BUILD
Nicholas Junge e45585a4b8
Change nanobind linkage to response file approach on macOS (#1638)
* Change nanobind linkage to response file approach

This change needs https://github.com/bazelbuild/bazel/pull/18952 to be
merged first. Fixes macOS linkage of GBM's nanobind bindings on macOS by
supplying a linker response file instead of `-undefined dynamic_lookup`.

The latter has since been deprecated on macOS.

* Fix bazel_skylib checksum, bump skylib version in MODULE.bazel

* Bump Bazel to version 6.4.0 for linker response file support
2023-10-24 13:04:12 +01:00

34 lines
811 B
Plaintext

licenses(["notice"])
package(default_visibility = ["//visibility:public"])
filegroup(
name = "symboltable",
srcs = ["cmake/darwin-ld-cpython.sym"],
)
cc_library(
name = "nanobind",
srcs = glob([
"src/*.cpp"
]),
copts = ["-fexceptions"],
includes = ["include", "ext/robin_map/include"],
textual_hdrs = glob(
[
"include/**/*.h",
"src/*.h",
"ext/robin_map/include/tsl/*.h",
],
),
linkopts = select({
"@platforms//os:macos": ["-Wl,@$(location :cmake/darwin-ld-cpython.sym)"],
"//conditions:default": [],
}),
additional_linker_inputs = select({
"@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"],
"//conditions:default": [],
}),
deps = ["@python_headers"],
)