From cba2f6c66ef27c992072afa79ebaae541814506b Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 19 May 2024 07:07:04 +0800 Subject: [PATCH] Fix-ups for macOS (#291) * Do not use precomp headers target with GCC on Apple * CMakeLists: also link to AudioUnit on Apple * platform.cpp: add missing --------- Co-authored-by: ouwou <26526779+ouwou@users.noreply.github.com> --- CMakeLists.txt | 5 ++++- src/platform.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 236dbd2..99cc9ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,9 @@ if (ENABLE_QRCODE_LOGIN) target_compile_definitions(abaddon PRIVATE WITH_QRLOGIN) endif () -target_precompile_headers(abaddon PRIVATE src/abaddon.hpp src/util.hpp) +if (NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) + target_precompile_headers(abaddon PRIVATE src/abaddon.hpp src/util.hpp) +endif() if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND @@ -146,6 +148,7 @@ if (APPLE) target_link_libraries(abaddon "-framework CoreFoundation") target_link_libraries(abaddon "-framework CoreAudio") target_link_libraries(abaddon "-framework AudioToolbox") + target_link_libraries(abaddon "-framework AudioUnit") endif () if (ENABLE_VOICE) diff --git a/src/platform.cpp b/src/platform.cpp index a26822d..ce0ac74 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -4,6 +4,10 @@ #include #include +#ifdef __APPLE__ + #include +#endif + #include using namespace std::literals::string_literals;