|
| 1 | +diff --git a/BUILD.bazel b/BUILD.bazel |
| 2 | +new file mode 100644 |
| 3 | +index 0000000..9e13986 |
| 4 | +--- /dev/null |
| 5 | ++++ b/BUILD.bazel |
| 6 | +@@ -0,0 +1,60 @@ |
| 7 | ++config_setting( |
| 8 | ++ name = "msvc_compiler", |
| 9 | ++ flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"}, |
| 10 | ++) |
| 11 | ++ |
| 12 | ++cc_library( |
| 13 | ++ name = "nanobind", |
| 14 | ++ srcs = [ |
| 15 | ++ "include/nanobind/stl/detail/nb_dict.h", |
| 16 | ++ "include/nanobind/stl/detail/nb_list.h", |
| 17 | ++ "include/nanobind/stl/detail/traits.h", |
| 18 | ++ "src/buffer.h", |
| 19 | ++ "src/common.cpp", |
| 20 | ++ "src/error.cpp", |
| 21 | ++ "src/hash.h", |
| 22 | ++ "src/implicit.cpp", |
| 23 | ++ "src/nb_enum.cpp", |
| 24 | ++ "src/nb_func.cpp", |
| 25 | ++ "src/nb_internals.cpp", |
| 26 | ++ "src/nb_internals.h", |
| 27 | ++ "src/nb_ndarray.cpp", |
| 28 | ++ "src/nb_static_property.cpp", |
| 29 | ++ "src/nb_type.cpp", |
| 30 | ++ "src/trampoline.cpp", |
| 31 | ++ ], |
| 32 | ++ hdrs = glob( |
| 33 | ++ include = [ |
| 34 | ++ "include/nanobind/*.h", |
| 35 | ++ "include/nanobind/eigen/*.h", |
| 36 | ++ "include/nanobind/stl/*.h", |
| 37 | ++ "include/nanobind/stl/detail/*.h", |
| 38 | ++ ], |
| 39 | ++ allow_empty = False, |
| 40 | ++ ), |
| 41 | ++ additional_linker_inputs = select({ |
| 42 | ++ "@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"], |
| 43 | ++ "//conditions:default": [], |
| 44 | ++ }), |
| 45 | ++ copts = select({ |
| 46 | ++ ":msvc_compiler": ["/std:c++17"], |
| 47 | ++ "//conditions:default": [ |
| 48 | ++ "--std=c++17", |
| 49 | ++ "-fexceptions", |
| 50 | ++ "-frtti", |
| 51 | ++ ], |
| 52 | ++ }), |
| 53 | ++ includes = ["include"], |
| 54 | ++ linkopts = select({ |
| 55 | ++ "@platforms//os:macos": [ |
| 56 | ++ "-Wl,@$(location :cmake/darwin-ld-cpython.sym)", |
| 57 | ++ ], |
| 58 | ++ "//conditions:default": [], |
| 59 | ++ }), |
| 60 | ++ strip_include_prefix = "include", |
| 61 | ++ visibility = ["//visibility:public"], |
| 62 | ++ deps = [ |
| 63 | ++ "@robin-map//:robin-map", |
| 64 | ++ "@rules_python//python/cc:current_py_cc_headers", |
| 65 | ++ ], |
| 66 | ++) |
0 commit comments