Skip to content

Commit

Permalink
feat: Add elinux support for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Losses committed Sep 13, 2024
1 parent a8ef9bf commit d30d90f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
25 changes: 25 additions & 0 deletions flutter_package/elinux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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.
$<TARGET_FILE:rinf>
PARENT_SCOPE
)

# Include the CMake build file of the Rust code.
include(./rust.cmake)
20 changes: 20 additions & 0 deletions flutter_package/elinux/rust.cmake
Original file line number Diff line number Diff line change
@@ -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
)

0 comments on commit d30d90f

Please sign in to comment.