@@ -5,23 +5,23 @@ index e936f66..eaac571 100644
5
5
@@ -21,7 +21,7 @@ option(BUILD_TESTS "Build tests." OFF)
6
6
# ============================================================================
7
7
# Find Python
8
-
8
+
9
9
- find_package(Python COMPONENTS Interpreter Development)
10
10
+ find_package(Python3 COMPONENTS Interpreter Development.Module)
11
-
11
+
12
12
# ============================================================================
13
13
# Build dependencies
14
14
@@ -47,8 +47,10 @@ pybind11_add_module(
15
15
pybind11_protobuf/proto_utils.h)
16
-
16
+
17
17
target_link_libraries(
18
18
- pybind11_proto_utils PRIVATE absl::strings protobuf::libprotobuf
19
19
- ${Python_LIBRARIES})
20
20
+ pybind11_proto_utils PRIVATE
21
21
+ absl::strings
22
22
+ protobuf::libprotobuf
23
23
+ Python3::Module)
24
-
24
+
25
25
target_include_directories(
26
26
pybind11_proto_utils PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS}
27
27
@@ -57,7 +59,7 @@ target_include_directories(
@@ -39,46 +39,20 @@ index e936f66..eaac571 100644
39
39
pybind11::pybind11
40
40
- ${Python_LIBRARIES})
41
41
+ Python3::Module)
42
-
42
+
43
43
target_include_directories(
44
44
pybind11_native_proto_caster
45
45
+ PUBLIC
46
46
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
47
47
PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS} ${protobuf_SOURCE_DIR}
48
48
${pybind11_INCLUDE_DIRS})
49
-
49
+
50
50
@@ -109,7 +113,7 @@ target_link_libraries(
51
51
absl::optional
52
52
protobuf::libprotobuf
53
53
pybind11::pybind11
54
54
- ${Python_LIBRARIES})
55
55
+ Python3::Module)
56
-
56
+
57
57
target_include_directories(
58
58
pybind11_wrapped_proto_caster
59
- diff --git a/pybind11_protobuf/proto_cast_util.cc b/pybind11_protobuf/proto_cast_util.cc
60
- index 06bde44..1cc6a30 100644
61
- --- a/pybind11_protobuf/proto_cast_util.cc
62
- +++ b/pybind11_protobuf/proto_cast_util.cc
63
- @@ -599,13 +599,14 @@ absl::optional<std::string> PyProtoDescriptorName(py::handle py_proto) {
64
-
65
- bool PyProtoIsCompatible(py::handle py_proto, const Descriptor* descriptor) {
66
- assert(PyGILState_Check());
67
- - if (descriptor->file()->pool() != DescriptorPool::generated_pool()) {
68
- - /// This indicates that the C++ descriptor does not come from the C++
69
- - /// DescriptorPool. This may happen if the C++ code has the same proto
70
- - /// in different descriptor pools, perhaps from different shared objects,
71
- - /// and could be result in undefined behavior.
72
- - return false;
73
- - }
74
- + // if (descriptor->file()->pool() != DescriptorPool::generated_pool()) {
75
- + // /// This indicates that the C++ descriptor does not come from the C++
76
- + // /// DescriptorPool. This may happen if the C++ code has the same proto
77
- + // /// in different descriptor pools, perhaps from different shared objects,
78
- + // /// and could be result in undefined behavior.
79
- + // std::cout << " * Different";
80
- + // return false;
81
- + // }
82
-
83
- auto py_descriptor = ResolveAttrs(py_proto, {"DESCRIPTOR"});
84
- if (!py_descriptor) {
0 commit comments