1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 15:23:48 +01:00

CMakeLists.txt for portmixer and portaudio

The support of ALSA, OSS and CoreAudio was added to portaudio. portmixer
was updated accordingly.
This commit is contained in:
Vitaliy Kirsanov
2019-04-06 11:33:24 +03:00
committed by James Crook
parent 0c38b9f41e
commit 5e2a426cb3
5 changed files with 84 additions and 38 deletions

View File

@@ -1,39 +1,32 @@
#directory cmake-proxies/portmixer
set( TARGET portmixer )
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
project( ${TARGET} )
set(TARGET portmixer)
set(TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET})
project(${TARGET})
set( SOURCES
#${LIB_SRC_DIRECTORY}portmixer/px_tests/px_test.c
#${LIB_SRC_DIRECTORY}portmixer/src/px_example_api.c
#${LIB_SRC_DIRECTORY}portmixer/src/px_linux_alsa.c
#${LIB_SRC_DIRECTORY}portmixer/src/px_mac_coreaudio.c
${LIB_SRC_DIRECTORY}portmixer/src/px_mixer.c
#${LIB_SRC_DIRECTORY}portmixer/src/px_unix_oss.c
${LIB_SRC_DIRECTORY}portmixer/src/px_win_common.c
${LIB_SRC_DIRECTORY}portmixer/src/px_win_ds.c
${LIB_SRC_DIRECTORY}portmixer/src/px_win_endpoint.c
${LIB_SRC_DIRECTORY}portmixer/src/px_win_wasapi.c
${LIB_SRC_DIRECTORY}portmixer/src/px_win_wmme.c
)
# This defines the #define on both Windows and Linux.
add_definitions(
-D_LIB
)
add_library( ${TARGET} STATIC ${SOURCES})
include(CheckIncludeFiles)
#if(MSVC)
#FIX-ME What a horrible hacky place for a config file!
add_definitions(/FI"${top_dir}/win/Projects/${TARGET}/Debug/config.h")
#else()
# GCC or Clang
# add_definitions(-include ${top_dir}/win/Projects/${TARGET}/config.h)
#endif()
get_target_property(PA_DEFINITIONS portaudio_static INTERFACE_COMPILE_DEFINITIONS)
add_library(${TARGET} STATIC
"${TARGET_SOURCE}/src/px_mixer.c"
"$<$<BOOL:${WIN32}>:${TARGET_SOURCE}/src/px_win_common.c>"
"$<$<BOOL:${WIN32}>:${TARGET_SOURCE}/src/px_win_ds.c>"
"$<$<BOOL:${WIN32}>:${TARGET_SOURCE}/src/px_win_endpoint.c>"
"$<$<BOOL:${WIN32}>:${TARGET_SOURCE}/src/px_win_wasapi.c>"
"$<$<BOOL:${WIN32}>:${TARGET_SOURCE}/src/px_win_wmme.c>"
"$<$<IN_LIST:PA_USE_ALSA=1,${PA_DEFINITIONS}>:${TARGET_SOURCE}/src/px_linux_alsa.c>"
"$<$<IN_LIST:PA_USE_OSS=1,${PA_DEFINITIONS}>:${TARGET_SOURCE}/src/px_unix_oss.c>"
"$<$<IN_LIST:PA_USE_COREAUDIO=1,${PA_DEFINITIONS}>:${TARGET_SOURCE}/src/px_mac_coreaudio.c>")
target_include_directories( ${TARGET} PRIVATE
${TARGET_SOURCE}/include
${LIB_SRC_DIRECTORY}/portaudio-v19/include
)
target_compile_definitions(${TARGET} PRIVATE
$<$<BOOL:${WIN32}>:PX_USE_WIN_DSOUND>
$<$<BOOL:${WIN32}>:PX_USE_WIN_MME>
$<$<BOOL:${WIN32}>:PX_USE_WIN_WASAPI>
$<$<IN_LIST:PA_USE_ALSA=1,${PA_DEFINITIONS}>:PX_USE_LINUX_ALSA>
$<$<IN_LIST:PA_USE_OSS=1,${PA_DEFINITIONS}>:PX_USE_UNIX_OSS>
$<$<IN_LIST:PA_USE_COREAUDIO=1,${PA_DEFINITIONS}>:PX_USE_MAC_COREAUDIO>)
target_link_libraries( ${TARGET} )
target_include_directories(${TARGET} PUBLIC "${TARGET_SOURCE}/include")
target_link_libraries(${TARGET} PUBLIC portaudio_static)
set_target_properties(${TARGET} PROPERTIES OSX_ARCHITECTURES "")