mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-30 16:42:07 +00:00
006d5f6f8b
* Reorganize examples to be in a separate workspace This will help to define native tools toolchains for examples * Remove examples-related part from main WORKSPACE file * Copy .bazelrc to the examples workspace. * correction for Bazel HEAD compatibility * Changes to run nested workspace tests from main workspace
29 lines
713 B
Python
29 lines
713 B
Python
load("@rules_foreign_cc//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",
|
|
],
|
|
)
|