blob: 7f822e90d3d40fdc959b99c3ae6a220cfdf56473 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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}
+)
|