aboutsummaryrefslogtreecommitdiff
path: root/audio/py-samplerate/files/patch-CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'audio/py-samplerate/files/patch-CMakeLists.txt')
-rw-r--r--audio/py-samplerate/files/patch-CMakeLists.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/audio/py-samplerate/files/patch-CMakeLists.txt b/audio/py-samplerate/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..7f822e90d3d4
--- /dev/null
+++ b/audio/py-samplerate/files/patch-CMakeLists.txt
@@ -0,0 +1,33 @@
+--- CMakeLists.txt.orig 2024-01-23 23:51:19 UTC
++++ CMakeLists.txt
+@@ -11,7 +11,9 @@ cmake_policy(SET CMP0094 NEW)
+ cmake_policy(SET CMP0094 NEW)
+
+ # adds the external dependencies
+-add_subdirectory(external)
++find_package(PkgConfig REQUIRED)
++find_package(pybind11 CONFIG REQUIRED)
++pkg_check_modules(SAMPLERATE REQUIRED IMPORTED_TARGET samplerate)
+
+ pybind11_add_module(python-samplerate src/samplerate.cpp)
+
+@@ -25,7 +27,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
+ 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 -Wall -Wextra)
+ endif()
+
+ ### stick the package and libsamplerate version into the module
+@@ -43,4 +45,9 @@ set_target_properties(
+ LINKER_LANGUAGE C
+ )
+
+-target_link_libraries(python-samplerate PUBLIC samplerate)
++target_compile_options(python-samplerate PRIVATE
++ ${SAMPLERATE_CFLAGS}
++)
++target_link_options(python-samplerate PRIVATE
++ ${SAMPLERATE_LDFLAGS}
++)