From e496ef925321ae70b0d6a265a5cc42515753dc65 Mon Sep 17 00:00:00 2001 From: Robin Scheibler Date: Sat, 27 Sep 2025 22:13:54 +0900 Subject: [PATCH 1/2] Updates pybind11 to 3.0.1. Fixes issue #28. --- CMakeLists.txt | 3 ++- external/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6635a53..6e99429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ # https://stackoverflow.com/questions/51907755/building-a-pybind11-module-with-cpp-and-cuda-sources-using-cmake cmake_minimum_required(VERSION 3.15) +set(CMAKE_POLICY_VERSION_MINIMUM 3.5) message(STATUS "Found Python prefix ${PYTHON_PREFIX}") list(PREPEND CMAKE_PREFIX_PATH "${PYTHON_PREFIX}") @@ -8,7 +9,7 @@ list(PREPEND CMAKE_PREFIX_PATH "${PYTHON_PREFIX}") project(python-samplerate) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -cmake_policy(SET CMP0094 NEW) +cmake_policy(SET CMP0148 NEW) # adds the external dependencies add_subdirectory(external) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index f41cf9e..45dbbeb 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -4,7 +4,7 @@ include(FetchContent) FetchContent_Declare( pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 - GIT_TAG 5b0a6fc2017fcc176545afe3e09c9f9885283242 # 2.10.4 + GIT_TAG f5fbe867d2d26e4a0a9177a51f6e568868ad3dc8 # 3.0.1 ) FetchContent_MakeAvailable(pybind11) From 6eeb2d01380b199f9bed9fe3a36e26687f669a4c Mon Sep 17 00:00:00 2001 From: Robin Scheibler Date: Sat, 27 Sep 2025 22:40:46 +0900 Subject: [PATCH 2/2] Adds the -fPIC flag for compilation to solve issue #19 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e99429..f1c2230 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32)) - target_compile_options(python-samplerate PRIVATE -std=c++14 -O3 -Wall -Wextra) + target_compile_options(python-samplerate PRIVATE -std=c++14 -O3 -Wall -Wextra -fPIC) endif() ### stick the package and libsamplerate version into the module