halkyon/third_party/flutter_tts/windows/CMakeLists.txt
Tizian 「ティツィアーン」 438ce20dbf
build: Android's built-in Kotlin, the three plugins applying KGP themselves patched in third_party/
AGP 9 compiles Kotlin itself (android.builtInKotlin=true in every app),
and warns that applying the Kotlin Gradle Plugin will soon fail.
flutter_web_auth_2 5.1.0, keyboard_height_plugin 0.3.0 and flutter_tts
4.2.5 still apply it unconditionally, so their pub releases are copied
into third_party/ with only their android/build.gradle changed, and
the root overrides them by path (third_party/README.md says when to
drop each). The servers' images copy third_party/, as pub refuses an
override whose path is missing. third_party/ isn't our own code: left
out of the analysis and the format check.

All four apps' APKs build without the warning. A Kotlin daemon's
session file that slipped into Train's android/ goes, and every app's
android/.gitignore keeps .kotlin/ out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-04 09:32:13 +01:00

55 lines
No EOL
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.14)
if(POLICY CMP0153)
cmake_policy(SET CMP0153 NEW)
endif()
set(PROJECT_NAME "flutter_tts")
project(${PROJECT_NAME} LANGUAGES CXX)
find_program(NUGET_EXE NAMES nuget)
if(NOT NUGET_EXE)
message(FATAL_ERROR "nuget.exe not found. Please install it.")
endif()
execute_process(
COMMAND ${NUGET_EXE} install Microsoft.Windows.CppWinRT
-Version 2.0.210503.1
-ExcludeVersion
-OutputDirectory ${CMAKE_BINARY_DIR}/packages
)
set(PLUGIN_NAME "flutter_tts_plugin")
add_library(${PLUGIN_NAME} SHARED
"flutter_tts_plugin.cpp"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN YES
)
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"
)
target_link_libraries(${PLUGIN_NAME} PRIVATE
flutter
flutter_wrapper_plugin
)
set_target_properties(${PLUGIN_NAME} PROPERTIES VS_PROJECT_IMPORT
"${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.props"
)
target_link_libraries(${PLUGIN_NAME} PRIVATE
"${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.targets"
)
set(flutter_tts_bundled_libraries "" PARENT_SCOPE)