TTS: Remove USE_PLATFORM_TTS defines

Use defined(USE_TTS) && defined(PLATFORM) instead
This commit is contained in:
Jaromir Wysoglad 2019-08-15 15:30:30 +02:00 committed by Filippos Karapetis
parent d49331132a
commit b97333d4b7
12 changed files with 29 additions and 34 deletions

View file

@ -166,6 +166,12 @@ MODULE_OBJS += \
plugins/posix/posix-provider.o \ plugins/posix/posix-provider.o \
saves/posix/posix-saves.o \ saves/posix/posix-saves.o \
taskbar/unity/unity-taskbar.o taskbar/unity/unity-taskbar.o
ifdef USE_TTS
MODULE_OBJS += \
text-to-speech/linux/linux-text-to-speech.o
endif
endif endif
ifdef MACOSX ifdef MACOSX
@ -176,6 +182,12 @@ MODULE_OBJS += \
midi/coremidi.o \ midi/coremidi.o \
updates/macosx/macosx-updates.o \ updates/macosx/macosx-updates.o \
taskbar/macosx/macosx-taskbar.o taskbar/macosx/macosx-taskbar.o
ifdef USE_TTS
MODULE_OBJS += \
text-to-speech/macosx/macosx-text-to-speech.o
endif
endif endif
ifdef WIN32 ifdef WIN32
@ -189,6 +201,12 @@ MODULE_OBJS += \
saves/windows/windows-saves.o \ saves/windows/windows-saves.o \
updates/win32/win32-updates.o \ updates/win32/win32-updates.o \
taskbar/win32/win32-taskbar.o taskbar/win32/win32-taskbar.o
ifdef USE_TTS
MODULE_OBJS += \
text-to-speech/windows/windows-text-to-speech.o
endif
endif endif
ifeq ($(BACKEND),android) ifeq ($(BACKEND),android)
@ -344,18 +362,5 @@ MODULE_OBJS += \
saves/recorder/recorder-saves.o saves/recorder/recorder-saves.o
endif endif
ifdef USE_LINUX_TTS
MODULE_OBJS += \
text-to-speech/linux/linux-text-to-speech.o
endif
ifdef USE_WINDOWS_TTS
MODULE_OBJS += \
text-to-speech/windows/windows-text-to-speech.o
endif
ifdef USE_MACOSX_TTS
MODULE_OBJS += \
text-to-speech/macosx/macosx-text-to-speech.o
endif
# Include common rules # Include common rules
include $(srcdir)/rules.mk include $(srcdir)/rules.mk

View file

@ -87,7 +87,7 @@ void OSystem_MacOSX::initBackend() {
_updateManager = new MacOSXUpdateManager(); _updateManager = new MacOSXUpdateManager();
#endif #endif
#ifdef USE_MACOSX_TTS #ifdef USE_TTS
// Initialize Text to Speech manager // Initialize Text to Speech manager
_textToSpeechManager = new MacOSXTextToSpeechManager(); _textToSpeechManager = new MacOSXTextToSpeechManager();
#endif #endif

View file

@ -55,7 +55,7 @@
#include <spawn.h> #include <spawn.h>
#endif #endif
#ifdef USE_LINUX_TTS #ifdef USE_TTS
#include "backends/text-to-speech/linux/linux-text-to-speech.h" #include "backends/text-to-speech/linux/linux-text-to-speech.h"
#endif #endif
extern char **environ; extern char **environ;
@ -83,7 +83,7 @@ void OSystem_POSIX::initBackend() {
if (_savefileManager == 0) if (_savefileManager == 0)
_savefileManager = new POSIXSaveFileManager(); _savefileManager = new POSIXSaveFileManager();
#ifdef USE_LINUX_TTS #ifdef USE_TTS
// Initialize Text to Speech manager // Initialize Text to Speech manager
_textToSpeechManager = new LinuxTextToSpeechManager(); _textToSpeechManager = new LinuxTextToSpeechManager();
#endif #endif

View file

@ -54,7 +54,7 @@
#include "common/ustr.h" #include "common/ustr.h"
#include "common/encoding.h" #include "common/encoding.h"
#ifdef USE_WINDOWS_TTS #if defined(USE_TTS)
#include "backends/text-to-speech/windows/windows-text-to-speech.h" #include "backends/text-to-speech/windows/windows-text-to-speech.h"
#endif #endif
@ -121,7 +121,7 @@ void OSystem_Win32::initBackend() {
#endif #endif
// Initialize text to speech // Initialize text to speech
#ifdef USE_WINDOWS_TTS #ifdef USE_TTS
_textToSpeechManager = new WindowsTextToSpeechManager(); _textToSpeechManager = new WindowsTextToSpeechManager();
#endif #endif

View file

@ -25,7 +25,7 @@
#include "backends/text-to-speech/linux/linux-text-to-speech.h" #include "backends/text-to-speech/linux/linux-text-to-speech.h"
#if defined(USE_LINUX_TTS) #if defined(USE_TTS) && defined(POSIX)
#include <speech-dispatcher/libspeechd.h> #include <speech-dispatcher/libspeechd.h>
#include "backends/platform/sdl/sdl-sys.h" #include "backends/platform/sdl/sdl-sys.h"

View file

@ -25,7 +25,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(USE_LINUX_TTS) #if defined(USE_TTS) && defined(POSIX)
#include "common/text-to-speech.h" #include "common/text-to-speech.h"
#include "common/str.h" #include "common/str.h"

View file

@ -25,7 +25,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(USE_MACOSX_TTS) #if defined(USE_TTS) && defined(MACOSX)
#include "common/text-to-speech.h" #include "common/text-to-speech.h"
#include "common/queue.h" #include "common/queue.h"

View file

@ -25,7 +25,7 @@
#include "backends/text-to-speech/macosx/macosx-text-to-speech.h" #include "backends/text-to-speech/macosx/macosx-text-to-speech.h"
#if defined(USE_MACOSX_TTS) #if defined(USE_TTS) && defined(MACOSX)
#include "common/translation.h" #include "common/translation.h"
#include <AppKit/NSSpeechSynthesizer.h> #include <AppKit/NSSpeechSynthesizer.h>
#include <Foundation/NSString.h> #include <Foundation/NSString.h>

View file

@ -25,7 +25,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#if defined(USE_WINDOWS_TTS) #if defined(USE_TTS) && defined(WIN32)
#include <basetyps.h> #include <basetyps.h>
#include <windows.h> #include <windows.h>
#include <Servprov.h> #include <Servprov.h>

View file

@ -25,7 +25,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(USE_WINDOWS_TTS) #if defined(USE_TTS) && defined(WIN32)
#include "common/text-to-speech.h" #include "common/text-to-speech.h"
#include "common/str.h" #include "common/str.h"

9
configure vendored
View file

@ -167,9 +167,6 @@ _libunity=auto
_dialogs=auto _dialogs=auto
_iconv=auto _iconv=auto
_tts=auto _tts=auto
_linux_tts=no
_windows_tts=no
_macosx_tts=no
# Default option behavior yes/no # Default option behavior yes/no
_debug_build=auto _debug_build=auto
_release_build=auto _release_build=auto
@ -5407,22 +5404,16 @@ else
linux*) linux*)
echo "linux" echo "linux"
_tts=yes _tts=yes
_linux_tts=yes
define_in_config_if_yes $_linux_tts 'USE_LINUX_TTS'
append_var LIBS '-lspeechd' append_var LIBS '-lspeechd'
;; ;;
mingw*) mingw*)
echo "win32" echo "win32"
_tts=yes _tts=yes
_windows_tts=yes
define_in_config_if_yes $_windows_tts 'USE_WINDOWS_TTS'
append_var LIBS '-lsapi -lole32' append_var LIBS '-lsapi -lole32'
;; ;;
darwin*) darwin*)
echo "osx" echo "osx"
_tts=yes _tts=yes
_macosx_tts=yes
define_in_config_if_yes $_macosx_tts 'USE_MACOSX_TTS'
;; ;;
*) *)
echo "no" echo "no"

View file

@ -428,7 +428,6 @@ int main(int argc, char *argv[]) {
if (ttsEnabled) { if (ttsEnabled) {
setup.libraries.push_back("sapi"); setup.libraries.push_back("sapi");
setup.defines.push_back("USE_WINDOWS_TTS");
} }
setup.defines.push_back("SDL_BACKEND"); setup.defines.push_back("SDL_BACKEND");