Skip to content
Draft
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ autom4te.cache/*
# Visual Studio 2017/2019 state folder
.vs/

# Visual Studio CMake build output folder
# Visual Studio CMake build output folder
out/

# Visual Studio CMake settings file
Expand All @@ -54,5 +54,8 @@ CMakeSettings.json
# VSCode
.vscode*

# JetBrains
.idea/

# Common build directories of users and VSCode
build*
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,24 @@ elseif(UNIX)

set(PKGCONFIG_LDFLAGS_PRIVATE
"${PKGCONFIG_LDFLAGS_PRIVATE} -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework CoreFoundation -framework CoreServices")
if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL "13.0")
# Add the ScreenCaptureKit framework
find_library(SCREENCAPTUREKIT_FRAMEWORK ScreenCaptureKit)
if(SCREENCAPTUREKIT_FRAMEWORK)
target_sources(PortAudio PRIVATE
src/hostapi/screencapturekit/pa_mac_screencapturekit.m
)
target_link_libraries(PortAudio
PRIVATE
-Wl,-framework,ScreenCaptureKit
-Wl,-framework,CoreMedia
-Wl,-framework,Foundation
)
target_compile_definitions(PortAudio PUBLIC PA_USE_SCREENCAPTUREKIT=1)
set(PKGCONFIG_CFLAGS "${PKGCONFIG_CFLAGS} -DPA_USE_SCREENCAPTUREKIT=1")
set(PKGCONFIG_LDFLAGS_PRIVATE "${PKGCONFIG_LDFLAGS_PRIVATE} -framework ScreenCaptureKit -framework CoreMedia -framework Foundation")
endif()
endif()
else()
# Some BSDs have a reimplementation of alsalib, so do not explicitly check for Linux.
find_package(ALSA)
Expand Down
3 changes: 2 additions & 1 deletion include/portaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ typedef enum PaHostApiTypeId
paAudioScienceHPI=14,
paAudioIO=15,
paPulseAudio=16,
paSndio=17
paSndio=17,
paScreenCaptureKit=18,
} PaHostApiTypeId;


Expand Down
Loading