Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endif()
project ("SRAL")
option (BUILD_SRAL_TEST "Build SRAL examples/tests" ON)
option (SRAL_DISABLE_UIA "Disable UIA (UI Automation) support" OFF)
option (SRAL_DISABLE_NSSPEECH "Disable NSSpeech (macOS-only NSSpeechSynthesizer) support" OFF)
add_library(${PROJECT_NAME}_obj OBJECT)
target_sources(${PROJECT_NAME}_obj PRIVATE
"SRC/Encoding.h" "SRC/Encoding.cpp"
Expand All @@ -41,7 +42,11 @@ if(WIN32)
endif()
elseif(APPLE)
target_sources(${PROJECT_NAME}_obj PRIVATE
"SRC/AVSpeech.h" "SRC/AVSpeech.mm" "SRC/NSSpeech.h" "SRC/NSSpeech.mm" "SRC/VoiceOver.h" "SRC/VoiceOver.mm")
"SRC/AVSpeech.h" "SRC/AVSpeech.mm" "SRC/VoiceOver.h" "SRC/VoiceOver.mm")
if(NOT SRAL_DISABLE_NSSPEECH)
target_sources(${PROJECT_NAME}_obj PRIVATE
"SRC/NSSpeech.h" "SRC/NSSpeech.mm")
endif()
else()
target_sources(${PROJECT_NAME}_obj PRIVATE
"Dep/utf-8.h" "Dep/utf-8.c" "SRC/SpeechDispatcher.h" "SRC/SpeechDispatcher.cpp")
Expand All @@ -54,6 +59,9 @@ target_compile_definitions(${PROJECT_NAME}_obj PRIVATE _CRT_SECURE_NO_WARNINGS)
if(SRAL_DISABLE_UIA)
target_compile_definitions(${PROJECT_NAME}_obj PRIVATE SRAL_NO_UIA)
endif()
if(SRAL_DISABLE_NSSPEECH)
target_compile_definitions(${PROJECT_NAME}_obj PRIVATE SRAL_NO_NSSPEECH)
endif()

if(BUILD_SHARED_LIBS)
add_library(${PROJECT_NAME} SHARED
Expand Down
4 changes: 4 additions & 0 deletions SRC/SRAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#include <tlhelp32.h>
#elif defined(__APPLE__)
#include "AVSpeech.h"
#ifndef SRAL_NO_NSSPEECH
#include "NSSpeech.h"
#endif
#include "VoiceOver.h"
#else
#include "SpeechDispatcher.h"
Expand Down Expand Up @@ -229,7 +231,9 @@ extern "C" SRAL_API bool SRAL_Initialize(int engines_exclude) {
#elif defined(__APPLE__)
g_engines[SRAL_ENGINE_VOICE_OVER] = std::make_unique<Sral::VoiceOver>();
g_engines[SRAL_ENGINE_AV_SPEECH] = std::make_unique<Sral::AvSpeech>();
#ifndef SRAL_NO_NSSPEECH
g_engines[SRAL_ENGINE_NS_SPEECH] = std::make_unique<Sral::NsSpeech>();
#endif
#else
g_engines[SRAL_ENGINE_SPEECH_DISPATCHER] = std::make_unique<Sral::SpeechDispatcher>();
#endif
Expand Down
Loading