Commit d5d07895 by Ralf W. Grosse-Kunstleve Committed by Copybara-Service

Internal change.

PiperOrigin-RevId: 493294082
parent b6b25a77
# Pybind11 bindings for the Abseil C++ Common Libraries
# LOAD(pytype_pybind_extension)
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension", "pybind_library")
package(default_visibility = ["//visibility:public"])
......@@ -150,16 +149,30 @@ pybind_library(
],
)
pybind_extension(
name = "status",
srcs = ["status.cc"],
deps = [":register_status_bindings"],
pybind_library(
name = "status_pyinit_google3",
srcs = ["status_pyinit_google3.cc"],
visibility = ["//visibility:private"],
deps = [
":register_status_bindings",
],
)
cc_binary(
name = "status.so",
srcs = ["status_pyinit_relative.cc"],
linkshared = 1,
deps = [
":status_pyinit_google3",
"@local_config_python//:python_headers", # buildcleaner: keep
],
)
pybind_library(
name = "import_status_module",
srcs = ["import_status_module.cc"],
hdrs = ["import_status_module.h"],
data = ["status.so"],
)
pybind_library(
......
#include <pybind11/pybind11.h>
#include "pybind11_abseil/register_status_bindings.h"
namespace pybind11 {
namespace google {
PYBIND11_MODULE(status, m) { internal::RegisterStatusBindings(m); }
} // namespace google
} // namespace pybind11
#include <Python.h>
#include <pybind11/pybind11.h>
#include "pybind11_abseil/register_status_bindings.h"
namespace {
PyObject* this_module_init() noexcept {
PYBIND11_CHECK_PYTHON_VERSION
PYBIND11_ENSURE_INTERNALS_READY
static pybind11::module_::module_def module_def_status;
auto m = pybind11::module_::create_extension_module("status", nullptr,
&module_def_status);
try {
pybind11::google::internal::RegisterStatusBindings(m);
return m.ptr();
}
PYBIND11_CATCH_INIT_EXCEPTIONS
}
} // namespace
extern "C" PyObject*
GooglePyInit_google3_third__party_pybind11__abseil_status() {
return this_module_init();
}
#include <Python.h>
extern "C" PyObject*
GooglePyInit_google3_third__party_pybind11__abseil_status();
extern "C" PyObject* PyInit_status() {
return GooglePyInit_google3_third__party_pybind11__abseil_status();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment