Skip to content

Commit

Permalink
add static linking of libmm2.a for iOS
Browse files Browse the repository at this point in the history
KDF was not linked statically or bundled with the `komodo_defi_framework` package
  • Loading branch information
takenagain committed Jan 21, 2025
1 parent f48e35d commit cc2167d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Relative import to be able to reuse the C sources.
// See the comment in ../komodo_defi_framework.podspec for more information.
// #include "../../src/komodo_defi_framework.c"
#include "../../src/komodo_defi_framework.c"

40 changes: 36 additions & 4 deletions packages/komodo_defi_framework/ios/komodo_defi_framework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,40 @@ A new Flutter FFI plugin project.
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '12.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
s.swift_version = '5.0'
end

s.frameworks = [
'CoreFoundation',
'SystemConfiguration',
]

s.vendored_libraries = 'libmm2.a'
# s.vendored_libraries = 'libkdflib.dylib'

s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
'OTHER_LDFLAGS' => [
'-force_load "$(PODS_TARGET_SRCROOT)/libmm2.a"',
'-framework SystemConfiguration',
],
# # Add rpath to ensure dylib can be found at runtime
# 'LD_RUNPATH_SEARCH_PATHS' => [
# '$(inherited)',
# '@executable_path/Frameworks',
# '@loader_path/Frameworks'
# ]
}

s.user_target_xcconfig = {
'OTHER_LDFLAGS' => [
'-framework SystemConfiguration'
]
}

s.libraries = ['c++', 'resolv']

# Ensure the dylib is copied into the final app bundle
# s.preserve_paths = 'libkdflib.dylib'

end
20 changes: 0 additions & 20 deletions packages/komodo_defi_framework/ios/mm2_plugin.podspec

This file was deleted.

1 change: 1 addition & 0 deletions packages/komodo_defi_framework/src/komodo_defi_framework.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "komodo_defi_framework.h"

0 comments on commit cc2167d

Please sign in to comment.