diff options
author | Chun-Min Chang <[email protected]> | 2019-06-07 19:06:30 -0700 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2019-06-08 14:06:30 +1200 |
commit | acbed7de511e94df95c8ca8d15628d8403dfdcbc (patch) | |
tree | 4bd5edd8eb520cf882ed8f53b184794a3237f937 /CMakeLists.txt | |
parent | 421010c5498e37b5c2d0671d13fb19bd4a30cdb3 (diff) | |
download | cubeb-acbed7de511e94df95c8ca8d15628d8403dfdcbc.tar.gz cubeb-acbed7de511e94df95c8ca8d15628d8403dfdcbc.zip |
Add audiounit-rust backend (#511)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ea48923..92c876c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,9 @@ if (BUILD_RUST_LIBS) if(EXISTS "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs") set(USE_PULSE_RUST 1) endif() + if(EXISTS "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs") + set(USE_AUDIOUNIT_RUST 1) + endif() endif() # On OS/2, visibility attribute is not supported. @@ -248,6 +251,24 @@ if(USE_PULSE_RUST) optimized "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a") endif() +if(USE_AUDIOUNIT_RUST) + include(ExternalProject) + set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust) + ExternalProject_Add( + cubeb_coreaudio_rs + DOWNLOAD_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND cargo build COMMAND cargo build --release + BINARY_DIR "${CMAKE_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") +endif() + find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY) |