Skip to content

Commit

Permalink
(revert this commit later) Switch apple devices to use static linking
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryConrad committed Jul 31, 2024
1 parent a7ce74d commit 19d18ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/mimir/lib/src/interface.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:mimir/src/api.dart';
import 'package:mimir/src/frb_generated.dart';
Expand Down Expand Up @@ -45,7 +47,13 @@ class MimirInterface {
ioDirectory: ioDirectory,
webPrefix: webPrefix,
);
final lib = await loadExternalLibrary(libraryLoaderConfig);
// TODO(GregoryConrad): remove this once Flutter gets SPM or Native Assets
ExternalLibrary lib;
if (Platform.isIOS || Platform.isMacOS) {
lib = ExternalLibrary.process(iKnowHowToUseIt: true);
} else {
lib = await loadExternalLibrary(libraryLoaderConfig);
}
await RustLib.init(externalLibrary: lib);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ done

# Create XCFramework zip
FRAMEWORK="EmbeddedMilli.xcframework"
LIBNAME=libembedded_milli.dylib
LIBNAME=libembedded_milli.a
mkdir mac-lipo ios-sim-lipo
IOS_SIM_LIPO=ios-sim-lipo/$LIBNAME
MAC_LIPO=mac-lipo/$LIBNAME
Expand Down

0 comments on commit 19d18ad

Please sign in to comment.