diff --git a/Cargo.toml b/Cargo.toml index 68ba2ab3f..a3e2a66e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,7 +99,7 @@ async-process = "1.3" android_logger = "0.11" jni = "0.19.0" -[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies] +[target.'cfg(any(target_os = "android", target_os = "ios", target_os = "linux"))'.dependencies] flutter_rust_bridge = "1.30.0" [workspace] diff --git a/flutter/linux/CMakeLists.txt b/flutter/linux/CMakeLists.txt index 1e5caff11..28f309c7f 100644 --- a/flutter/linux/CMakeLists.txt +++ b/flutter/linux/CMakeLists.txt @@ -1,5 +1,5 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.12) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change @@ -56,6 +56,24 @@ pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") +# flutter_rust_bridge +find_package(Corrosion REQUIRED) + +corrosion_import_crate(MANIFEST_PATH ../../Cargo.toml + # Equivalent to --all-features passed to cargo build +# [ALL_FEATURES] + # Equivalent to --no-default-features passed to cargo build +# [NO_DEFAULT_FEATURES] + # Disable linking of standard libraries (required for no_std crates). +# [NO_STD] + # Specify cargo build profile (e.g. release or a custom profile) +# [PROFILE ] + # Only import the specified crates from a workspace +# [CRATES ... ] + # Enable the specified features +# [FEATURES ... ] +) + # Define the application target. To change its name, change BINARY_NAME above, # not the value here, or `flutter run` will no longer work. # @@ -74,6 +92,8 @@ apply_standard_settings(${BINARY_NAME}) target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +target_link_libraries(${BINARY_NAME} PRIVATE librustdesk) + # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble)