Skip to content

Commit

Permalink
Use new AudioDeviceLib project instead of embedding/copying C++
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Feb 13, 2021
1 parent ce1e9ed commit acd499e
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 1,064 deletions.
40 changes: 40 additions & 0 deletions AudioDeviceLib.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include(ExternalProject)

ExternalProject_Add(
AudioDeviceLib_build
GIT_REPOSITORY https://github.com/fredemmott/AudioDeviceLib
GIT_TAG a782d113e941aa57ced3c62414ae15da2ba6649c
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
)

ExternalProject_Get_Property(
AudioDeviceLib_build
INSTALL_DIR
)
add_library(AudioDeviceLib INTERFACE)
add_dependencies(AudioDeviceLib AudioDeviceLib_build)
target_link_libraries(
AudioDeviceLib
INTERFACE
${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}AudioDeviceLib${CMAKE_STATIC_LIBRARY_SUFFIX}
)
target_include_directories(AudioDeviceLib INTERFACE ${INSTALL_DIR}/include)

if(APPLE)
find_library(AUDIOTOOLBOX_FRAMEWORK AudioToolbox)
find_library(COREAUDIO_FRAMEWORK CoreAudio)
find_library(COREFOUNDATION_FRAMEWORK CoreFoundation)
target_link_libraries(
AudioDeviceLib
INTERFACE
${AUDIOTOOLBOX_FRAMEWORK}
${COREAUDIO_FRAMEWORK}
${COREFOUNDATION_FRAMEWORK}
)
elseif(WIN32)
target_link_libraries(AudioDeviceLib INTERFACE Winmm)
endif()
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ message(STATUS "Install dir: ${CMAKE_INSTALL_PREFIX}")

include_directories("${CMAKE_SOURCE_DIR}")

include("AudioDeviceLib.cmake")
include("StreamDeckSDK.cmake")

include(sign_target.cmake)
Expand Down
45 changes: 0 additions & 45 deletions Sources/AudioDevices-inline.h

This file was deleted.

115 changes: 0 additions & 115 deletions Sources/AudioDevices.h

This file was deleted.

Loading

0 comments on commit acd499e

Please sign in to comment.