From 9e13331d2fb2fc9d96c882173de0c588bfe3cb16 Mon Sep 17 00:00:00 2001 From: Danilo Costa Viana Date: Sat, 24 Aug 2024 14:03:08 -0300 Subject: [PATCH] Adjustments to make the preprocessor compile the winrt SpeechSynthesis code path instead of the SAPI one --- example/windows/CMakeLists.txt | 2 +- example/winuwp/CMakeLists.txt | 2 +- windows/CMakeLists.txt | 3 ++- windows/flutter_tts_plugin.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/example/windows/CMakeLists.txt b/example/windows/CMakeLists.txt index 1633297a..94ae86a7 100644 --- a/example/windows/CMakeLists.txt +++ b/example/windows/CMakeLists.txt @@ -31,7 +31,7 @@ add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_features(${TARGET} PUBLIC cxx_std_20) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") diff --git a/example/winuwp/CMakeLists.txt b/example/winuwp/CMakeLists.txt index 0e2c05b3..6c8e7ac1 100644 --- a/example/winuwp/CMakeLists.txt +++ b/example/winuwp/CMakeLists.txt @@ -34,7 +34,7 @@ add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_features(${TARGET} PUBLIC cxx_std_20) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100" /await) target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 572ccca3..9f5bc333 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -22,7 +22,8 @@ add_library(${PLUGIN_NAME} SHARED ) apply_standard_settings(${PLUGIN_NAME}) set_target_properties(${PLUGIN_NAME} PROPERTIES - CXX_VISIBILITY_PRESET hidden) +CXX_VISIBILITY_PRESET hidden) +target_compile_features(${PLUGIN_NAME} PUBLIC cxx_std_20) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/windows/flutter_tts_plugin.cpp b/windows/flutter_tts_plugin.cpp index bed43115..2ee59500 100644 --- a/windows/flutter_tts_plugin.cpp +++ b/windows/flutter_tts_plugin.cpp @@ -15,7 +15,7 @@ typedef std::unique_ptr> FlutterR std::unique_ptr> methodChannel; -#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) #include #include #include