fix: macos compilation

This commit is contained in:
SoLongAndThanksForAllThePizza 2022-06-02 16:13:34 +08:00
parent aefc968246
commit d756551791
15 changed files with 1344 additions and 236 deletions

417
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ libc = "0.2"
parity-tokio-ipc = { git = "https://github.com/open-trade/parity-tokio-ipc" }
flexi_logger = { version = "0.22", features = ["async", "use_chrono_for_offset"] }
runas = "0.2"
magnum-opus = { git = "https://github.com/open-trade/magnum-opus" }
magnum-opus = { git = "https://github.com/SoLongAndThanksForAllThePizza/magnum-opus" }
dasp = { version = "0.11", features = ["signal", "interpolate-linear", "interpolate"], optional = true }
rubato = { version = "0.12", optional = true }
samplerate = { version = "0.2", optional = true }
@ -53,7 +53,7 @@ rpassword = "6.0"
base64 = "0.13"
sysinfo = "0.23"
num_cpus = "1.13"
flutter_rust_bridge = { version = "1.30.0", optional = true }
flutter_rust_bridge = { git = "https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge", optional = true }
[target.'cfg(not(target_os = "linux"))'.dependencies]
reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features=false }
@ -102,7 +102,7 @@ android_logger = "0.11"
jni = "0.19.0"
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
flutter_rust_bridge = "1.30.0"
flutter_rust_bridge = { git = "https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge" }
[workspace]
members = ["libs/scrap", "libs/hbb_common", "libs/enigo", "libs/clipboard", "libs/virtual_display"]

View File

@ -71,6 +71,8 @@ fn gen_flutter_rust_bridge() {
rust_input: "src/flutter_ffi.rs".to_string(),
// Path of output generated Dart code
dart_output: "flutter/lib/generated_bridge.dart".to_string(),
// Path of output generated C header
c_output: Some(vec!["flutter/macos/Runner/bridge_generated.h".to_string()]),
// for other options lets use default
..Default::default()
};

View File

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"

View File

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"

40
flutter/macos/Podfile Normal file
View File

@ -0,0 +1,40 @@
platform :osx, '10.12'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_macos_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end

196
flutter/macos/Podfile.lock Normal file
View File

@ -0,0 +1,196 @@
PODS:
- bitsdojo_window_macos (0.0.1):
- FlutterMacOS
- desktop_multi_window (0.0.1):
- FlutterMacOS
- device_info_plus_macos (0.0.1):
- FlutterMacOS
- Firebase/Analytics (8.15.0):
- Firebase/Core
- Firebase/Core (8.15.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 8.15.0)
- Firebase/CoreOnly (8.15.0):
- FirebaseCore (= 8.15.0)
- firebase_analytics (9.1.9):
- Firebase/Analytics (= 8.15.0)
- firebase_core
- FlutterMacOS
- firebase_core (1.17.1):
- Firebase/CoreOnly (~> 8.15.0)
- FlutterMacOS
- FirebaseAnalytics (8.15.0):
- FirebaseAnalytics/AdIdSupport (= 8.15.0)
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- FirebaseAnalytics/AdIdSupport (8.15.0):
- FirebaseCore (~> 8.0)
- FirebaseInstallations (~> 8.0)
- GoogleAppMeasurement (= 8.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- FirebaseCore (8.15.0):
- FirebaseCoreDiagnostics (~> 8.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- FirebaseCoreDiagnostics (8.15.0):
- GoogleDataTransport (~> 9.1)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/Logger (~> 7.7)
- nanopb (~> 2.30908.0)
- FirebaseInstallations (8.15.0):
- FirebaseCore (~> 8.0)
- GoogleUtilities/Environment (~> 7.7)
- GoogleUtilities/UserDefaults (~> 7.7)
- PromisesObjC (< 3.0, >= 1.2)
- FlutterMacOS (1.0.0)
- GoogleAppMeasurement (8.15.0):
- GoogleAppMeasurement/AdIdSupport (= 8.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/AdIdSupport (8.15.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 8.15.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleAppMeasurement/WithoutAdIdSupport (8.15.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
- GoogleUtilities/MethodSwizzler (~> 7.7)
- GoogleUtilities/Network (~> 7.7)
- "GoogleUtilities/NSData+zlib (~> 7.7)"
- nanopb (~> 2.30908.0)
- GoogleDataTransport (9.1.4):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.7.0):
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.7.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (7.7.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (7.7.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.7.0)"
- GoogleUtilities/Reachability (7.7.0):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.7.0):
- GoogleUtilities/Logger
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- package_info_plus_macos (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1):
- FlutterMacOS
- PromisesObjC (2.1.0)
- shared_preferences_macos (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- wakelock_macos (0.0.1):
- FlutterMacOS
- window_manager (0.2.0):
- FlutterMacOS
DEPENDENCIES:
- bitsdojo_window_macos (from `Flutter/ephemeral/.symlinks/plugins/bitsdojo_window_macos/macos`)
- desktop_multi_window (from `Flutter/ephemeral/.symlinks/plugins/desktop_multi_window/macos`)
- device_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos`)
- firebase_analytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_analytics/macos`)
- firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
SPEC REPOS:
trunk:
- Firebase
- FirebaseAnalytics
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleUtilities
- nanopb
- PromisesObjC
EXTERNAL SOURCES:
bitsdojo_window_macos:
:path: Flutter/ephemeral/.symlinks/plugins/bitsdojo_window_macos/macos
desktop_multi_window:
:path: Flutter/ephemeral/.symlinks/plugins/desktop_multi_window/macos
device_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/device_info_plus_macos/macos
firebase_analytics:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_analytics/macos
firebase_core:
:path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos
path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
shared_preferences_macos:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
wakelock_macos:
:path: Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
bitsdojo_window_macos: 44e3b8fe3dd463820e0321f6256c5b1c16bb6a00
desktop_multi_window: 566489c048b501134f9d7fb6a2354c60a9126486
device_info_plus_macos: 1ad388a1ef433505c4038e7dd9605aadd1e2e9c7
Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
firebase_analytics: d448483150504ed84f25c5437a34af2591a7929e
firebase_core: 7b87364e2d1eae70018a60698e89e7d6f5320bad
FirebaseAnalytics: 7761cbadb00a717d8d0939363eb46041526474fa
FirebaseCore: 5743c5785c074a794d35f2fff7ecc254a91e08b1
FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
GoogleAppMeasurement: 4c19f031220c72464d460c9daa1fb5d1acce958e
GoogleDataTransport: 5fffe35792f8b96ec8d6775f5eccd83c998d5a3b
GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72
shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176
COCOAPODS: 1.11.3

View File

@ -26,6 +26,9 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
C5E54335B73C89F72DB1B606 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26C84465887F29AE938039CB /* Pods_Runner.framework */; };
CC13D44B2847D53E00EF8B54 /* librustdesk.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CC13D4362847C8C200EF8B54 /* librustdesk.dylib */; };
CC13D4502847D5E800EF8B54 /* librustdesk.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = CC13D4362847C8C200EF8B54 /* librustdesk.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -36,6 +39,41 @@
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
remoteInfo = FLX;
};
CC13D4352847C8C200EF8B54 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CA6071B5A0F5A7A3EF2297AA;
remoteInfo = "librustdesk-cdylib";
};
CC13D4372847C8C200EF8B54 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CA604C7415FB2A3731F5016A;
remoteInfo = "librustdesk-staticlib";
};
CC13D4392847C8C200EF8B54 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CA60D3BC5386D3D7DBD96893;
remoteInfo = "naming-bin";
};
CC13D43B2847C8C200EF8B54 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CA60D3BC5386B357B2AB834F;
remoteInfo = "rustdesk-bin";
};
CC13D43D2847C8CB00EF8B54 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = CA6071B5A0F5D6691E4C3FF1;
remoteInfo = "librustdesk-cdylib";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
@ -45,6 +83,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
CC13D4502847D5E800EF8B54 /* librustdesk.dylib in Bundle Framework */,
);
name = "Bundle Framework";
runOnlyForDeploymentPostprocessing = 0;
@ -52,9 +91,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
26C84465887F29AE938039CB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
295AD07E63F13855C270A0E0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* flutter_hbb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_hbb.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* flutter_hbb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = flutter_hbb.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@ -66,8 +107,12 @@
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
7436B85D94E8F7B5A9324869 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
C3BB669FF6190AE1B11BCAEA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = rustdesk.xcodeproj; sourceTree = SOURCE_ROOT; };
CCB6FE9A2848A6B800E58D48 /* bridge_generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bridge_generated.h; path = Runner/bridge_generated.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -75,6 +120,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CC13D44B2847D53E00EF8B54 /* librustdesk.dylib in Frameworks */,
C5E54335B73C89F72DB1B606 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -95,10 +142,12 @@
33CC10E42044A3C60003C045 = {
isa = PBXGroup;
children = (
CCB6FE9A2848A6B800E58D48 /* bridge_generated.h */,
33FAB671232836740065AC1E /* Runner */,
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
A6C450E1C32EC39A23170131 /* Pods */,
);
sourceTree = "<group>";
};
@ -135,6 +184,7 @@
33FAB671232836740065AC1E /* Runner */ = {
isa = PBXGroup;
children = (
CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */,
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
@ -145,9 +195,31 @@
path = Runner;
sourceTree = "<group>";
};
A6C450E1C32EC39A23170131 /* Pods */ = {
isa = PBXGroup;
children = (
7436B85D94E8F7B5A9324869 /* Pods-Runner.debug.xcconfig */,
295AD07E63F13855C270A0E0 /* Pods-Runner.release.xcconfig */,
C3BB669FF6190AE1B11BCAEA /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
CC13D42F2847C8C200EF8B54 /* Products */ = {
isa = PBXGroup;
children = (
CC13D4362847C8C200EF8B54 /* librustdesk.dylib */,
CC13D4382847C8C200EF8B54 /* liblibrustdesk_static.a */,
CC13D43A2847C8C200EF8B54 /* naming */,
CC13D43C2847C8C200EF8B54 /* rustdesk */,
);
name = Products;
sourceTree = "<group>";
};
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
26C84465887F29AE938039CB /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -159,15 +231,18 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
610B125EE2B990E4D4B30D05 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
4688A20DD8E4F3E900927B2C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
CC13D43E2847C8CB00EF8B54 /* PBXTargetDependency */,
33CC11202044C79F0003C045 /* PBXTargetDependency */,
);
name = Runner;
@ -212,6 +287,12 @@
mainGroup = 33CC10E42044A3C60003C045;
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = CC13D42F2847C8C200EF8B54 /* Products */;
ProjectRef = CC13D42E2847C8C200EF8B54 /* rustdesk.xcodeproj */;
},
);
projectRoot = "";
targets = (
33CC10EC2044A3C60003C045 /* Runner */,
@ -220,6 +301,37 @@
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
CC13D4362847C8C200EF8B54 /* librustdesk.dylib */ = {
isa = PBXReferenceProxy;
fileType = "compiled.mach-o.dylib";
path = librustdesk.dylib;
remoteRef = CC13D4352847C8C200EF8B54 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
CC13D4382847C8C200EF8B54 /* liblibrustdesk_static.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = liblibrustdesk_static.a;
remoteRef = CC13D4372847C8C200EF8B54 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
CC13D43A2847C8C200EF8B54 /* naming */ = {
isa = PBXReferenceProxy;
fileType = "compiled.mach-o.executable";
path = naming;
remoteRef = CC13D4392847C8C200EF8B54 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
CC13D43C2847C8C200EF8B54 /* rustdesk */ = {
isa = PBXReferenceProxy;
fileType = "compiled.mach-o.executable";
path = rustdesk;
remoteRef = CC13D43B2847C8C200EF8B54 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
33CC10EB2044A3C60003C045 /* Resources */ = {
isa = PBXResourcesBuildPhase;
@ -270,6 +382,45 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
4688A20DD8E4F3E900927B2C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
610B125EE2B990E4D4B30D05 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -291,6 +442,11 @@
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
};
CC13D43E2847C8CB00EF8B54 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "librustdesk-cdylib";
targetProxy = CC13D43D2847C8CB00EF8B54 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@ -493,6 +649,7 @@
"@executable_path/../Frameworks",
);
PROVISIONING_PROFILE_SPECIFIER = "";
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = Runner/bridge_generated.h;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
@ -513,6 +670,7 @@
"@executable_path/../Frameworks",
);
PROVISIONING_PROFILE_SPECIFIER = "";
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = Runner/bridge_generated.h;
SWIFT_VERSION = 5.0;
};
name = Release;

View File

@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -4,6 +4,7 @@ import FlutterMacOS
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
dummy_method_to_enforce_bundling()
return true
}
}

View File

@ -4,6 +4,10 @@ import bitsdojo_window_macos
class MainFlutterWindow: BitsdojoWindow {
override func awakeFromNib() {
if (!rustdesk_core_main()){
print("Rustdesk core returns false, exiting without launching Flutter app")
NSApplication.shared.terminate(self)
}
let flutterViewController = FlutterViewController.init()
let windowFrame = self.frame
self.contentViewController = flutterViewController

View File

@ -0,0 +1,201 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct wire_uint_8_list {
uint8_t *ptr;
int32_t len;
} wire_uint_8_list;
typedef struct WireSyncReturnStruct {
uint8_t *ptr;
int32_t len;
bool success;
} WireSyncReturnStruct;
typedef int64_t DartPort;
typedef bool (*DartPostCObjectFnType)(DartPort port_id, void *message);
void wire_rustdesk_core_main(int64_t port_);
void wire_start_global_event_stream(int64_t port_);
void wire_session_connect(int64_t port_, struct wire_uint_8_list *id, bool is_file_transfer);
void wire_get_session_remember(int64_t port_, struct wire_uint_8_list *id);
void wire_get_session_toggle_option(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *arg);
struct WireSyncReturnStruct wire_get_session_toggle_option_sync(struct wire_uint_8_list *id,
struct wire_uint_8_list *arg);
void wire_get_session_image_quality(int64_t port_, struct wire_uint_8_list *id);
void wire_get_session_option(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *arg);
void wire_session_login(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *password,
bool remember);
void wire_session_close(int64_t port_, struct wire_uint_8_list *id);
void wire_session_refresh(int64_t port_, struct wire_uint_8_list *id);
void wire_session_reconnect(int64_t port_, struct wire_uint_8_list *id);
void wire_session_toggle_option(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *value);
void wire_session_set_image_quality(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *value);
void wire_session_lock_screen(int64_t port_, struct wire_uint_8_list *id);
void wire_session_ctrl_alt_del(int64_t port_, struct wire_uint_8_list *id);
void wire_session_switch_display(int64_t port_, struct wire_uint_8_list *id, int32_t value);
void wire_session_input_key(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *name,
bool down,
bool press,
bool alt,
bool ctrl,
bool shift,
bool command);
void wire_session_input_string(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *value);
void wire_session_send_chat(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *text);
void wire_session_send_mouse(int64_t port_,
struct wire_uint_8_list *id,
int32_t mask,
int32_t x,
int32_t y,
bool alt,
bool ctrl,
bool shift,
bool command);
void wire_session_peer_option(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *name,
struct wire_uint_8_list *value);
void wire_session_input_os_password(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *value);
void wire_session_read_remote_dir(int64_t port_,
struct wire_uint_8_list *id,
struct wire_uint_8_list *path,
bool include_hidden);
void wire_session_send_files(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
struct wire_uint_8_list *path,
struct wire_uint_8_list *to,
int32_t file_num,
bool include_hidden,
bool is_remote);
void wire_session_set_confirm_override_file(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
int32_t file_num,
bool need_override,
bool remember,
bool is_upload);
void wire_session_remove_file(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
struct wire_uint_8_list *path,
int32_t file_num,
bool is_remote);
void wire_session_read_dir_recursive(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
struct wire_uint_8_list *path,
bool is_remote);
void wire_session_remove_all_empty_dirs(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
struct wire_uint_8_list *path,
bool is_remote);
void wire_session_cancel_job(int64_t port_, struct wire_uint_8_list *id, int32_t act_id);
void wire_session_create_dir(int64_t port_,
struct wire_uint_8_list *id,
int32_t act_id,
struct wire_uint_8_list *path,
bool is_remote);
struct wire_uint_8_list *new_uint_8_list(int32_t len);
void free_WireSyncReturnStruct(struct WireSyncReturnStruct val);
void store_dart_post_cobject(DartPostCObjectFnType ptr);
/**
* FFI for rustdesk core's main entry.
* Return true if the app should continue running with UI(possibly Flutter), false if the app should exit.
*/
bool rustdesk_core_main(void);
static int64_t dummy_method_to_enforce_bundling(void) {
int64_t dummy_var = 0;
dummy_var ^= ((int64_t) (void*) wire_rustdesk_core_main);
dummy_var ^= ((int64_t) (void*) wire_start_global_event_stream);
dummy_var ^= ((int64_t) (void*) wire_session_connect);
dummy_var ^= ((int64_t) (void*) wire_get_session_remember);
dummy_var ^= ((int64_t) (void*) wire_get_session_toggle_option);
dummy_var ^= ((int64_t) (void*) wire_get_session_toggle_option_sync);
dummy_var ^= ((int64_t) (void*) wire_get_session_image_quality);
dummy_var ^= ((int64_t) (void*) wire_get_session_option);
dummy_var ^= ((int64_t) (void*) wire_session_login);
dummy_var ^= ((int64_t) (void*) wire_session_close);
dummy_var ^= ((int64_t) (void*) wire_session_refresh);
dummy_var ^= ((int64_t) (void*) wire_session_reconnect);
dummy_var ^= ((int64_t) (void*) wire_session_toggle_option);
dummy_var ^= ((int64_t) (void*) wire_session_set_image_quality);
dummy_var ^= ((int64_t) (void*) wire_session_lock_screen);
dummy_var ^= ((int64_t) (void*) wire_session_ctrl_alt_del);
dummy_var ^= ((int64_t) (void*) wire_session_switch_display);
dummy_var ^= ((int64_t) (void*) wire_session_input_key);
dummy_var ^= ((int64_t) (void*) wire_session_input_string);
dummy_var ^= ((int64_t) (void*) wire_session_send_chat);
dummy_var ^= ((int64_t) (void*) wire_session_send_mouse);
dummy_var ^= ((int64_t) (void*) wire_session_peer_option);
dummy_var ^= ((int64_t) (void*) wire_session_input_os_password);
dummy_var ^= ((int64_t) (void*) wire_session_read_remote_dir);
dummy_var ^= ((int64_t) (void*) wire_session_send_files);
dummy_var ^= ((int64_t) (void*) wire_session_set_confirm_override_file);
dummy_var ^= ((int64_t) (void*) wire_session_remove_file);
dummy_var ^= ((int64_t) (void*) wire_session_read_dir_recursive);
dummy_var ^= ((int64_t) (void*) wire_session_remove_all_empty_dirs);
dummy_var ^= ((int64_t) (void*) wire_session_cancel_job);
dummy_var ^= ((int64_t) (void*) wire_session_create_dir);
dummy_var ^= ((int64_t) (void*) new_uint_8_list);
dummy_var ^= ((int64_t) (void*) free_WireSyncReturnStruct);
dummy_var ^= ((int64_t) (void*) store_dart_post_cobject);
return dummy_var;
}

View File

@ -0,0 +1,439 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objects = {
/* Begin PBXBuildFile section */
CA6061C6409F12977AAB839F /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA603C4309E13EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--lib"; }; };
CA6061C6409FC858B7409EE3 /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA603C4309E13EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--bin naming"; }; };
CA6061C6409FC9FA710A2219 /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA603C4309E13EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--bin rustdesk"; }; };
CA6061C6409FD6691E4C3FF1 /* Cargo.toml in Sources */ = {isa = PBXBuildFile; fileRef = CA603C4309E13EF4668187A5 /* Cargo.toml */; settings = {COMPILER_FLAGS = "--lib"; }; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
CA603C4309E1AC6C1400ACA8 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.proxy.script;
dependencyFile = "$(DERIVED_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME).d";
filePatterns = "*/Cargo.toml";
fileType = pattern.proxy;
inputFiles = (
);
isEditable = 0;
name = "Cargo project build";
outputFiles = (
"$(OBJECT_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME)",
);
script = "# generated with cargo-xcode 1.4.1\n\nset -eu; export PATH=$PATH:~/.cargo/bin:/usr/local/bin;\nif [ \"${IS_MACCATALYST-NO}\" = YES ]; then\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-ios-macabi\"\nelse\n CARGO_XCODE_TARGET_TRIPLE=\"${CARGO_XCODE_TARGET_ARCH}-apple-${CARGO_XCODE_TARGET_OS}\"\nfi\nif [ \"$CARGO_XCODE_TARGET_OS\" != \"darwin\" ]; then\n PATH=\"${PATH/\\/Contents\\/Developer\\/Toolchains\\/XcodeDefault.xctoolchain\\/usr\\/bin:/xcode-provided-ld-cant-link-lSystem-for-the-host-build-script:}\"\nfi\nPATH=\"$PATH:/opt/homebrew/bin\" # Rust projects often depend on extra tools like nasm, which Xcode lacks\nif [ \"$CARGO_XCODE_BUILD_MODE\" == release ]; then\n OTHER_INPUT_FILE_FLAGS=\"${OTHER_INPUT_FILE_FLAGS} --release\"\nfi\nif command -v rustup &> /dev/null; then\n if ! rustup target list --installed | egrep -q \"${CARGO_XCODE_TARGET_TRIPLE}\"; then\n echo \"warning: this build requires rustup toolchain for $CARGO_XCODE_TARGET_TRIPLE, but it isn't installed\"\n rustup target add \"${CARGO_XCODE_TARGET_TRIPLE}\" || echo >&2 \"warning: can't install $CARGO_XCODE_TARGET_TRIPLE\"\n fi\nfi\nif [ \"$ACTION\" = clean ]; then\n ( set -x; cargo clean --manifest-path=\"$SCRIPT_INPUT_FILE\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\"; );\nelse\n ( set -x; cargo build --manifest-path=\"$SCRIPT_INPUT_FILE\" --features=\"${CARGO_XCODE_FEATURES:-}\" ${OTHER_INPUT_FILE_FLAGS} --target=\"${CARGO_XCODE_TARGET_TRIPLE}\"; );\nfi\n# it's too hard to explain Cargo's actual exe path to Xcode build graph, so hardlink to a known-good path instead\nBUILT_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_FILE_NAME}\"\nln -f -- \"$BUILT_SRC\" \"$SCRIPT_OUTPUT_FILE_0\"\n\n# xcode generates dep file, but for its own path, so append our rename to it\nDEP_FILE_SRC=\"${CARGO_TARGET_DIR}/${CARGO_XCODE_TARGET_TRIPLE}/${CARGO_XCODE_BUILD_MODE}/${CARGO_XCODE_CARGO_DEP_FILE_NAME}\"\nif [ -f \"$DEP_FILE_SRC\" ]; then\n DEP_FILE_DST=\"${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d\"\n cp -f \"$DEP_FILE_SRC\" \"$DEP_FILE_DST\"\n echo >> \"$DEP_FILE_DST\" \"$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC\"\nfi\n\n# lipo script needs to know all the platform-specific files that have been built\n# archs is in the file name, so that paths don't stay around after archs change\n# must match input for LipoScript\nFILE_LIST=\"${DERIVED_FILE_DIR}/${ARCHS}-${EXECUTABLE_NAME}.xcfilelist\"\ntouch \"$FILE_LIST\"\nif ! egrep -q \"$SCRIPT_OUTPUT_FILE_0\" \"$FILE_LIST\" ; then\n echo >> \"$FILE_LIST\" \"$SCRIPT_OUTPUT_FILE_0\"\nfi\n";
};
/* End PBXBuildRule section */
/* Begin PBXFileReference section */
ADDEDBA66A6E1 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
CA603C4309E13EF4668187A5 /* Cargo.toml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cargo.toml; path = /Users/ruizruiz/Work/Code/Projects/RustDesk/rustdesk/Cargo.toml; sourceTree = "<group>"; };
CA604C7415FB2A3731F5016A /* liblibrustdesk_static.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibrustdesk_static.a; sourceTree = BUILT_PRODUCTS_DIR; };
CA6071B5A0F5A7A3EF2297AA /* librustdesk.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = librustdesk.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
CA60D3BC5386B357B2AB834F /* rustdesk */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = rustdesk; sourceTree = BUILT_PRODUCTS_DIR; };
CA60D3BC5386D3D7DBD96893 /* naming */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = naming; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
ADDEDBA66A6E2 /* Required for static linking */ = {
isa = PBXGroup;
children = (
ADDEDBA66A6E1 /* libresolv.tbd */,
);
name = "Required for static linking";
sourceTree = "<group>";
};
CA603C4309E122869D176AE5 /* Products */ = {
isa = PBXGroup;
children = (
CA6071B5A0F5A7A3EF2297AA /* librustdesk.dylib */,
CA604C7415FB2A3731F5016A /* liblibrustdesk_static.a */,
CA60D3BC5386D3D7DBD96893 /* naming */,
CA60D3BC5386B357B2AB834F /* rustdesk */,
);
name = Products;
sourceTree = "<group>";
};
CA603C4309E198AF0B5890DB /* Frameworks */ = {
isa = PBXGroup;
children = (
ADDEDBA66A6E2 /* Required for static linking */,
);
name = Frameworks;
sourceTree = "<group>";
};
CA603C4309E1D65BC3C892A8 = {
isa = PBXGroup;
children = (
CA603C4309E13EF4668187A5 /* Cargo.toml */,
CA603C4309E122869D176AE5 /* Products */,
CA603C4309E198AF0B5890DB /* Frameworks */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
CA604C7415FB12977AAB839F /* librustdesk-staticlib */ = {
isa = PBXNativeTarget;
buildConfigurationList = CA6028B9540B12977AAB839F /* Build configuration list for PBXNativeTarget "librustdesk-staticlib" */;
buildPhases = (
CA6033723F8212977AAB839F /* Sources */,
CA603C4309E1AF6EBB7F357C /* Universal Binary lipo */,
);
buildRules = (
CA603C4309E1AC6C1400ACA8 /* PBXBuildRule */,
);
dependencies = (
);
name = "librustdesk-staticlib";
productName = liblibrustdesk_static.a;
productReference = CA604C7415FB2A3731F5016A /* liblibrustdesk_static.a */;
productType = "com.apple.product-type.library.static";
};
CA6071B5A0F5D6691E4C3FF1 /* librustdesk-cdylib */ = {
isa = PBXNativeTarget;
buildConfigurationList = CA6028B9540BD6691E4C3FF1 /* Build configuration list for PBXNativeTarget "librustdesk-cdylib" */;
buildPhases = (
CA6033723F82D6691E4C3FF1 /* Sources */,
CA603C4309E1AF6EBB7F357C /* Universal Binary lipo */,
);
buildRules = (
CA603C4309E1AC6C1400ACA8 /* PBXBuildRule */,
);
dependencies = (
);
name = "librustdesk-cdylib";
productName = librustdesk.dylib;
productReference = CA6071B5A0F5A7A3EF2297AA /* librustdesk.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
CA60D3BC5386C858B7409EE3 /* naming-bin */ = {
isa = PBXNativeTarget;
buildConfigurationList = CA6028B9540BC858B7409EE3 /* Build configuration list for PBXNativeTarget "naming-bin" */;
buildPhases = (
CA6033723F82C858B7409EE3 /* Sources */,
CA603C4309E1AF6EBB7F357C /* Universal Binary lipo */,
);
buildRules = (
CA603C4309E1AC6C1400ACA8 /* PBXBuildRule */,
);
dependencies = (
);
name = "naming-bin";
productName = naming;
productReference = CA60D3BC5386D3D7DBD96893 /* naming */;
productType = "com.apple.product-type.tool";
};
CA60D3BC5386C9FA710A2219 /* rustdesk-bin */ = {
isa = PBXNativeTarget;
buildConfigurationList = CA6028B9540BC9FA710A2219 /* Build configuration list for PBXNativeTarget "rustdesk-bin" */;
buildPhases = (
CA6033723F82C9FA710A2219 /* Sources */,
CA603C4309E1AF6EBB7F357C /* Universal Binary lipo */,
);
buildRules = (
CA603C4309E1AC6C1400ACA8 /* PBXBuildRule */,
);
dependencies = (
);
name = "rustdesk-bin";
productName = rustdesk;
productReference = CA60D3BC5386B357B2AB834F /* rustdesk */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
CA603C4309E1E04653AD465F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
TargetAttributes = {
CA604C7415FB12977AAB839F = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
CA6071B5A0F5D6691E4C3FF1 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
CA60D3BC5386C858B7409EE3 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
CA60D3BC5386C9FA710A2219 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = CA603C4309E180E02D6C7F57 /* Build configuration list for PBXProject "rustdesk" */;
compatibilityVersion = "Xcode 11.4";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = CA603C4309E1D65BC3C892A8;
productRefGroup = CA603C4309E122869D176AE5 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
CA6071B5A0F5D6691E4C3FF1 /* librustdesk-cdylib */,
CA604C7415FB12977AAB839F /* librustdesk-staticlib */,
CA60D3BC5386C858B7409EE3 /* naming-bin */,
CA60D3BC5386C9FA710A2219 /* rustdesk-bin */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
CA603C4309E1AF6EBB7F357C /* Universal Binary lipo */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(DERIVED_FILE_DIR)/$(ARCHS)-$(EXECUTABLE_NAME).xcfilelist",
);
name = "Universal Binary lipo";
outputFileListPaths = (
);
outputPaths = (
"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# generated with cargo-xcode 1.4.1\nset -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr '\\n' '\\0' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
CA6033723F8212977AAB839F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA6061C6409F12977AAB839F /* Cargo.toml in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CA6033723F82C858B7409EE3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA6061C6409FC858B7409EE3 /* Cargo.toml in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CA6033723F82C9FA710A2219 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA6061C6409FC9FA710A2219 /* Cargo.toml in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
CA6033723F82D6691E4C3FF1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CA6061C6409FD6691E4C3FF1 /* Cargo.toml in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
CA604B55B26012977AAB839F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = liblibrustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = liblibrustdesk.a;
INSTALL_GROUP = "";
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
PRODUCT_NAME = librustdesk_static;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos";
};
name = Debug;
};
CA604B55B260C858B7409EE3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = naming.d;
CARGO_XCODE_CARGO_FILE_NAME = naming;
PRODUCT_NAME = naming;
SUPPORTED_PLATFORMS = macosx;
};
name = Debug;
};
CA604B55B260C9FA710A2219 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = rustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = rustdesk;
PRODUCT_NAME = rustdesk;
SUPPORTED_PLATFORMS = macosx;
};
name = Debug;
};
CA604B55B260D6691E4C3FF1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = liblibrustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = liblibrustdesk.dylib;
PRODUCT_NAME = librustdesk;
SUPPORTED_PLATFORMS = macosx;
};
name = Debug;
};
CA60583BB9CE12977AAB839F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = liblibrustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = liblibrustdesk.a;
INSTALL_GROUP = "";
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
PRODUCT_NAME = librustdesk_static;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos";
};
name = Release;
};
CA60583BB9CEC858B7409EE3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = naming.d;
CARGO_XCODE_CARGO_FILE_NAME = naming;
PRODUCT_NAME = naming;
SUPPORTED_PLATFORMS = macosx;
};
name = Release;
};
CA60583BB9CEC9FA710A2219 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = rustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = rustdesk;
PRODUCT_NAME = rustdesk;
SUPPORTED_PLATFORMS = macosx;
};
name = Release;
};
CA60583BB9CED6691E4C3FF1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CARGO_XCODE_CARGO_DEP_FILE_NAME = liblibrustdesk.d;
CARGO_XCODE_CARGO_FILE_NAME = liblibrustdesk.dylib;
PRODUCT_NAME = librustdesk;
SUPPORTED_PLATFORMS = macosx;
};
name = Release;
};
CA608F3F78EE228BE02872F8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CARGO_TARGET_DIR = "$(PROJECT_TEMP_DIR)/cargo_target";
CARGO_XCODE_BUILD_MODE = debug;
CARGO_XCODE_FEATURES = "";
"CARGO_XCODE_TARGET_ARCH[arch=arm64*]" = aarch64;
"CARGO_XCODE_TARGET_ARCH[arch=i386]" = i686;
"CARGO_XCODE_TARGET_ARCH[arch=x86_64*]" = x86_64;
"CARGO_XCODE_TARGET_OS[sdk=appletvos*]" = tvos;
"CARGO_XCODE_TARGET_OS[sdk=appletvsimulator*]" = tvos;
"CARGO_XCODE_TARGET_OS[sdk=iphoneos*]" = ios;
"CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*]" = "ios-sim";
"CARGO_XCODE_TARGET_OS[sdk=macosx*]" = darwin;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = rustdesk;
SDKROOT = macosx;
SUPPORTS_MACCATALYST = YES;
};
name = Debug;
};
CA608F3F78EE3CC16B37690B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CARGO_TARGET_DIR = "$(PROJECT_TEMP_DIR)/cargo_target";
CARGO_XCODE_BUILD_MODE = release;
CARGO_XCODE_FEATURES = "";
"CARGO_XCODE_TARGET_ARCH[arch=arm64*]" = aarch64;
"CARGO_XCODE_TARGET_ARCH[arch=i386]" = i686;
"CARGO_XCODE_TARGET_ARCH[arch=x86_64*]" = x86_64;
"CARGO_XCODE_TARGET_OS[sdk=appletvos*]" = tvos;
"CARGO_XCODE_TARGET_OS[sdk=appletvsimulator*]" = tvos;
"CARGO_XCODE_TARGET_OS[sdk=iphoneos*]" = ios;
"CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*]" = "ios-sim";
"CARGO_XCODE_TARGET_OS[sdk=macosx*]" = darwin;
PRODUCT_NAME = rustdesk;
SDKROOT = macosx;
SUPPORTS_MACCATALYST = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
CA6028B9540B12977AAB839F /* Build configuration list for PBXNativeTarget "librustdesk-staticlib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA60583BB9CE12977AAB839F /* Release */,
CA604B55B26012977AAB839F /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CA6028B9540BC858B7409EE3 /* Build configuration list for PBXNativeTarget "naming-bin" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA60583BB9CEC858B7409EE3 /* Release */,
CA604B55B260C858B7409EE3 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CA6028B9540BC9FA710A2219 /* Build configuration list for PBXNativeTarget "rustdesk-bin" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA60583BB9CEC9FA710A2219 /* Release */,
CA604B55B260C9FA710A2219 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CA6028B9540BD6691E4C3FF1 /* Build configuration list for PBXNativeTarget "librustdesk-cdylib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA60583BB9CED6691E4C3FF1 /* Release */,
CA604B55B260D6691E4C3FF1 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CA603C4309E180E02D6C7F57 /* Build configuration list for PBXProject "rustdesk" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA608F3F78EE3CC16B37690B /* Release */,
CA608F3F78EE228BE02872F8 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = CA603C4309E1E04653AD465F /* Project object */;
}

View File

@ -3,9 +3,8 @@ use std::{
path::{Path, PathBuf},
};
fn find_package(name: &str) -> Vec<PathBuf> {
let vcpkg_root = std::env::var("VCPKG_ROOT").unwrap();
let mut path: PathBuf = vcpkg_root.into();
/// Link vcppkg package.
fn link_vcpkg(mut path: PathBuf, name: &str) -> PathBuf {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mut target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if target_arch == "x86_64" {
@ -26,8 +25,13 @@ fn find_package(name: &str) -> Vec<PathBuf> {
println!("cargo:info={}", target);
path.push("installed");
path.push(target);
let lib = name.trim_start_matches("lib").to_string();
println!("{}", format!("cargo:rustc-link-lib=static={}", lib));
println!(
"{}",
format!(
"cargo:rustc-link-lib=static={}",
name.trim_start_matches("lib")
)
);
println!(
"{}",
format!(
@ -37,7 +41,68 @@ fn find_package(name: &str) -> Vec<PathBuf> {
);
let include = path.join("include");
println!("{}", format!("cargo:include={}", include.to_str().unwrap()));
vec![include]
include
}
/// Link homebrew package(for Mac M1).
fn link_homebrew_m1(name: &str) -> PathBuf {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if target_os != "macos" || target_arch != "aarch64" {
panic!("Couldn't find VCPKG_ROOT, also can't fallback to homebrew because it's only for macos aarch64.");
}
let mut path = PathBuf::from("/opt/homebrew/Cellar");
path.push(name);
let entries = if let Ok(dir) = std::fs::read_dir(&path) {
dir
} else {
panic!("Could not find package in {}. Make sure your homebrew and package {} are all installed.", path.to_str().unwrap(),&name);
};
let mut directories = entries
.into_iter()
.filter(|x| x.is_ok())
.map(|x| x.unwrap().path())
.filter(|x| x.is_dir())
.collect::<Vec<_>>();
// Find the newest version.
directories.sort_unstable();
if directories.is_empty() {
panic!(
"There's no installed version of {} in /opt/homebrew/Cellar",
name
);
}
path.push(directories.pop().unwrap());
// Link the library.
println!(
"{}",
format!(
"cargo:rustc-link-lib=static={}",
name.trim_start_matches("lib")
)
);
// Add the library path.
println!(
"{}",
format!(
"cargo:rustc-link-search={}",
path.join("lib").to_str().unwrap()
)
);
// Add the include path.
let include = path.join("include");
println!("{}", format!("cargo:include={}", include.to_str().unwrap()));
include
}
/// Find package. By default, it will try to find vcpkg first, then homebrew(currently only for Mac M1).
fn find_package(name: &str) -> Vec<PathBuf> {
if let Ok(vcpkg_root) = std::env::var("VCPKG_ROOT") {
vec![link_vcpkg(vcpkg_root.into(), name)]
} else {
// Try using homebrew
vec![link_homebrew_m1(name)]
}
}
fn generate_bindings(

View File

@ -1,5 +1,3 @@
#[cfg(target_os = "macos")]
mod macos;
use crate::common::SOFTWARE_UPDATE_URL;
use crate::ipc;
use hbb_common::{