fix: can't find rustdesk.so

This commit is contained in:
Asura
2022-08-24 17:10:34 -07:00
parent cd4f578cf7
commit b38c3299d8
6 changed files with 240 additions and 197 deletions

View File

@@ -74,6 +74,8 @@ corrosion_import_crate(MANIFEST_PATH ../../Cargo.toml
# [FEATURES <feature1> ... <featureN>]
)
set(BASE_RUSTDESK "librustdesk")
# Define the application target. To change its name, change BINARY_NAME above,
# not the value here, or `flutter run` will no longer work.
#
@@ -91,8 +93,8 @@ apply_standard_settings(${BINARY_NAME})
# Add dependency libraries. Add any application-specific dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
target_link_libraries(${BINARY_NAME} PRIVATE librustdesk)
target_link_libraries(${BINARY_NAME} PRIVATE ${BASE_RUSTDESK})
# 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)
@@ -142,6 +144,8 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
COMPONENT Runtime)
endforeach(bundled_library)
install(FILES $<TARGET_FILE:${BASE_RUSTDESK}-shared> DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime RENAME librustdesk.so)
# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")

View File

@@ -1,7 +1,8 @@
#include <dlfcn.h>
#include "my_application.h"
#define RUSTDESK_LIB_PATH "/usr/lib/rustdesk/librustdesk.so"
#define RUSTDESK_LIB_PATH "ibrustdesk.so"
// #define RUSTDESK_LIB_PATH "/usr/lib/rustdesk/librustdesk.so"
typedef bool (*RustDeskCoreMain)();
bool flutter_rustdesk_core_main() {