diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-04-11 04:36:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 04:36:27 +0000 |
commit | 44ab35dfd591c4c357673cc2ce3cb3a6964a1fff (patch) | |
tree | 91a60f1dfdd9d5a7e1c88b0eef0990981a307ada /CMakeLists.txt | |
parent | 0b663246809519487c155c51ccebb8df0e14a227 (diff) | |
parent | f5228d91d28e39d56c7245ecf0128895273c9ec0 (diff) | |
download | abaddon-portaudio-44ab35dfd591c4c357673cc2ce3cb3a6964a1fff.tar.gz abaddon-portaudio-44ab35dfd591c4c357673cc2ce3cb3a6964a1fff.zip |
Merge pull request #145 from uowuo/notifications
Notifications
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 cf44f0a..a3af60f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") option(USE_LIBHANDY "Enable features that require libhandy (default)" ON) option(USE_KEYCHAIN "Store the token in the keychain (default)" ON) +option(ENABLE_NOTIFICATION_SOUNDS "Enable notification sounds (default)" ON) find_package(nlohmann_json REQUIRED) find_package(CURL) @@ -48,6 +49,9 @@ file(GLOB_RECURSE ABADDON_SOURCES "src/*.cpp" ) +list(FILTER ABADDON_SOURCES EXCLUDE REGEX ".*notifier_gio\\.cpp$") +list(FILTER ABADDON_SOURCES EXCLUDE REGEX ".*notifier_null\\.cpp$") + add_executable(abaddon ${ABADDON_SOURCES}) target_include_directories(abaddon PUBLIC ${PROJECT_SOURCE_DIR}/src) target_include_directories(abaddon PUBLIC ${PROJECT_BINARY_DIR}) @@ -64,6 +68,12 @@ if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR target_link_libraries(abaddon stdc++fs) endif () +if (NOT WIN32) + target_sources(abaddon PRIVATE src/notifications/notifier_gio.cpp) +else () + target_sources(abaddon PRIVATE src/notifications/notifier_null.cpp) +endif () + if (IXWebSocket_LIBRARIES) target_link_libraries(abaddon ${IXWebSocket_LIBRARIES}) find_library(MBEDTLS_X509_LIBRARY mbedx509) @@ -114,3 +124,14 @@ if (USE_KEYCHAIN) target_compile_definitions(abaddon PRIVATE WITH_KEYCHAIN) endif () endif () + +if (${ENABLE_NOTIFICATION_SOUNDS}) + set(USE_MINIAUDIO TRUE) + target_compile_definitions(abaddon PRIVATE ENABLE_NOTIFICATION_SOUNDS) +else () + set(USE_MINIAUDIO FALSE) +endif () + +if (USE_MINIAUDIO) + target_include_directories(abaddon PUBLIC subprojects/miniaudio) +endif () |