diff options
author | Guillaume Besson <[email protected]> | 2020-08-17 15:32:19 +0200 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2020-09-28 14:23:32 +0200 |
commit | 082ba33d120d484c4d5e2404dbda69c1f7e6751b (patch) | |
tree | 10415bbb35f16aa277d6c97a9965942e848dcdc1 | |
parent | 1d480fafaad2fd6aad39b80a3cbc8e8c1cb0a980 (diff) | |
download | cubeb-082ba33d120d484c4d5e2404dbda69c1f7e6751b.tar.gz cubeb-082ba33d120d484c4d5e2404dbda69c1f7e6751b.zip |
Fix CMake rust path and only use rust deps if needed
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fc134d..349ba8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,7 +231,7 @@ if(USE_KAI) target_link_libraries(cubeb PRIVATE kai) endif() -if(USE_PULSE_RUST) +if(USE_PULSE AND USE_PULSE_RUST) include(ExternalProject) set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust) ExternalProject_Add( @@ -240,17 +240,17 @@ if(USE_PULSE_RUST) CONFIGURE_COMMAND "" BUILD_COMMAND cargo build COMMAND cargo build --release BUILD_ALWAYS ON - BINARY_DIR "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs" + BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs" INSTALL_COMMAND "" LOG_BUILD ON) add_dependencies(cubeb cubeb_pulse_rs) target_compile_definitions(cubeb PRIVATE USE_PULSE_RUST) target_link_libraries(cubeb PRIVATE - debug "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a" - optimized "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse) + debug "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a" + optimized "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse) endif() -if(USE_AUDIOUNIT_RUST) +if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST) include(ExternalProject) set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust) ExternalProject_Add( @@ -259,14 +259,14 @@ if(USE_AUDIOUNIT_RUST) CONFIGURE_COMMAND "" BUILD_COMMAND cargo build COMMAND cargo build --release BUILD_ALWAYS ON - BINARY_DIR "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs" + BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs" INSTALL_COMMAND "" LOG_BUILD ON) add_dependencies(cubeb cubeb_coreaudio_rs) target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT_RUST) target_link_libraries(cubeb PRIVATE - debug "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a" - optimized "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a") + debug "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a" + optimized "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a") endif() find_package(Doxygen) |