LevelDB project 1 10225501460 林子骥 10211900416 郭夏辉
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

2 months ago
  1. config_setting(
  2. name = "msvc_compiler",
  3. flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
  4. )
  5. cc_library(
  6. name = "nanobind",
  7. hdrs = glob(
  8. include = [
  9. "include/nanobind/*.h",
  10. "include/nanobind/stl/*.h",
  11. "include/nanobind/detail/*.h",
  12. ],
  13. exclude = [],
  14. ),
  15. srcs = [
  16. "include/nanobind/stl/detail/nb_dict.h",
  17. "include/nanobind/stl/detail/nb_list.h",
  18. "include/nanobind/stl/detail/traits.h",
  19. "ext/robin_map/include/tsl/robin_map.h",
  20. "ext/robin_map/include/tsl/robin_hash.h",
  21. "ext/robin_map/include/tsl/robin_growth_policy.h",
  22. "ext/robin_map/include/tsl/robin_set.h",
  23. "src/buffer.h",
  24. "src/common.cpp",
  25. "src/error.cpp",
  26. "src/implicit.cpp",
  27. "src/nb_enum.cpp",
  28. "src/nb_func.cpp",
  29. "src/nb_internals.cpp",
  30. "src/nb_internals.h",
  31. "src/nb_ndarray.cpp",
  32. "src/nb_type.cpp",
  33. "src/trampoline.cpp",
  34. ],
  35. copts = select({
  36. ":msvc_compiler": [],
  37. "//conditions:default": [
  38. "-fexceptions",
  39. "-Os", # size optimization
  40. "-flto", # enable LTO
  41. ],
  42. }),
  43. linkopts = select({
  44. "@com_github_google_benchmark//:macos": [
  45. "-undefined dynamic_lookup",
  46. "-Wl,-no_fixup_chains",
  47. "-Wl,-dead_strip",
  48. ],
  49. "//conditions:default": [],
  50. }),
  51. includes = ["include", "ext/robin_map/include"],
  52. deps = ["@python_headers"],
  53. visibility = ["//visibility:public"],
  54. )