forked from pybind/pybind11_bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pybind11-BUILD.bazel
38 lines (34 loc) · 1.05 KB
/
pybind11-BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# pybind11 - Seamless operability between C++11 and Python.
load("@rules_cc//cc:defs.bzl", "cc_library")
licenses(["notice"])
exports_files(["LICENSE"])
cc_library(
name = "pybind11",
hdrs = glob(
include = [
"include/pybind11/**/*.h",
],
exclude = [
# Deprecated file that just emits a warning
"include/pybind11/common.h",
],
),
copts = select({
":msvc_compiler": [],
"//conditions:default": [
"-fexceptions",
# Useless warnings
"-Xclang-only=-Wno-undefined-inline",
"-Xclang-only=-Wno-pragma-once-outside-header",
"-Xgcc-only=-Wno-error", # no way to just disable the pragma-once warning in gcc
],
}),
includes = ["include"],
visibility = ["//visibility:public"],
deps = ["@rules_python//python/cc:current_py_cc_headers"],
)
config_setting(
name = "msvc_compiler",
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
visibility = ["//visibility:public"],
)