2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-05 14:02:22 +00:00
rules_foreign_cc/examples/pybind11/BUILD
irengrig 8590cb0da8
Add building example with pybind11 (#43)
- demonstrates loading CMake scripts from externally built library for use in the dependent external library CMake build
2018-08-20 21:41:16 +02:00

29 lines
696 B
Python

load("//tools/build_defs:cmake.bzl", "cmake_external")
cmake_external(
name = "pybind11",
# turn off testing
cmake_options = ["-DPYBIND11_TEST=False"],
headers_only = True,
lib_source = "@pybind11//:all",
)
filegroup(
name = "example_src",
srcs = glob(["example/**"]),
)
cmake_external(
name = "example_bind",
# include system headers, change this to appropriate value
env_vars = {
"CXXFLAGS": "-isystem=/usr/include/python2.7 -fPIC",
"CFLAGS": "-isystem=/usr/include/python2.7 -fPIC",
},
lib_source = ":example_src",
shared_libraries = ["example.cpython-35m-x86_64-linux-gnu.so"],
deps = [
":pybind11",
],
)