1
0
Files
pybind11-abseil/find-and-link-python-libs.patch
2024-04-30 12:49:48 +00:00

31 lines
1.2 KiB
Diff

---
CMakeLists.txt | 3 +++
pybind11_abseil/CMakeLists.txt | 1 +
2 files changed, 4 insertions(+)
Index: pybind11_abseil-202402.0/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/CMakeLists.txt
+++ pybind11_abseil-202402.0/CMakeLists.txt
@@ -16,6 +16,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3
cmake_policy(SET CMP0135 NEW)
endif()
+# Needs to be called *before* looking for pybind11 to ensure pybind11 uses the same python
+find_package(Python COMPONENTS Interpreter Development)
+
FetchContent_Declare(
absl
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
Index: pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/pybind11_abseil/CMakeLists.txt
+++ pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt
@@ -1,5 +1,6 @@
add_subdirectory(compat)
add_subdirectory(cpp_capsule_tools)
+link_libraries(${Python_LIBRARIES})
# absl_casters ============================================================
add_library(absl_casters INTERFACE)