diff --git a/flutter_package/cargokit/build_tool/lib/src/target.dart b/flutter_package/cargokit/build_tool/lib/src/target.dart index 9287b23c7..a7132530c 100644 --- a/flutter_package/cargokit/build_tool/lib/src/target.dart +++ b/flutter_package/cargokit/build_tool/lib/src/target.dart @@ -51,6 +51,14 @@ class Target { rust: 'aarch64-unknown-linux-gnu', flutter: 'linux-arm64', ), + Target( + rust: 'x86_64-unknown-linux-gnu', + flutter: 'elinux-x64', + ), + Target( + rust: 'aarch64-unknown-linux-gnu', + flutter: 'elinux-arm64', + ), Target( rust: 'x86_64-apple-darwin', darwinPlatform: 'macosx', diff --git a/flutter_package/elinux/CMakeLists.txt b/flutter_package/elinux/CMakeLists.txt new file mode 100644 index 000000000..61897ca53 --- /dev/null +++ b/flutter_package/elinux/CMakeLists.txt @@ -0,0 +1,25 @@ +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +# Project-level configuration. +set(PROJECT_NAME "rinf") +project(${PROJECT_NAME} LANGUAGES CXX) + +# Invoke the build for native code shared with the other target platforms. +# This can be changed to accommodate different builds. +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared") + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(rinf_bundled_libraries + # Defined in ../src/CMakeLists.txt. + # This can be changed to accommodate different builds. + $ + PARENT_SCOPE +) + +# Include the CMake build file of the Rust code. +include(./rust.cmake) \ No newline at end of file diff --git a/flutter_package/elinux/rust.cmake b/flutter_package/elinux/rust.cmake new file mode 100644 index 000000000..e4cf45a21 --- /dev/null +++ b/flutter_package/elinux/rust.cmake @@ -0,0 +1,20 @@ +cmake_policy(SET CMP0079 NEW) +apply_standard_settings(${BINARY_NAME}) + +set_target_properties( + ${BINARY_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden + BUILD_RPATH_USE_ORIGIN ON +) + +target_compile_definitions(${BINARY_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) +target_link_libraries(${BINARY_NAME} PRIVATE flutter) + +include("../cargokit/cmake/cargokit.cmake") +apply_cargokit(${BINARY_NAME} ${CMAKE_SOURCE_DIR}/../native/hub hub "") + +set( + rinf_bundled_libraries + "${${BINARY_NAME}_cargokit_lib}" + PARENT_SCOPE +) \ No newline at end of file diff --git a/flutter_package/pubspec.yaml b/flutter_package/pubspec.yaml index cbc9ade8f..7cb3a393c 100644 --- a/flutter_package/pubspec.yaml +++ b/flutter_package/pubspec.yaml @@ -45,6 +45,8 @@ flutter: ffiPlugin: true linux: ffiPlugin: true + elinux: + ffiPlugin: true macos: ffiPlugin: true windows: