From 405726e00c0074d544815ff03fea84a41f47dcea Mon Sep 17 00:00:00 2001 From: emc2314 Date: Thu, 6 Oct 2022 08:21:02 +0800 Subject: [PATCH] Try to fix iOS build --- codemagic.yaml | 38 +- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 71 +++- .../sudachi-ffi.xcodeproj/project.pbxproj | 371 ++++++++++++++++++ sudachi.rs/sudachi/src/plugin/loader.rs | 4 + 5 files changed, 476 insertions(+), 10 deletions(-) create mode 100644 sudachi.rs/sudachi-ffi/sudachi-ffi.xcodeproj/project.pbxproj diff --git a/codemagic.yaml b/codemagic.yaml index bc6587e..2a4d4ac 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -46,9 +46,15 @@ workflows: source "$HOME/.cargo/env" rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android aarch64-apple-ios cargo install cargo-ndk + - | + # build Android + source "$HOME/.cargo/env" flutter build apk --release - - find . -name "Podfile" -execdir pod install \; - - flutter build ios --release --no-codesign + - | + # build iOS + source "$HOME/.cargo/env" + find . -name "Podfile" -execdir pod install \; + flutter build ios --release --no-codesign - | #!/bin/sh mv build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/arujisho.apk @@ -71,6 +77,7 @@ workflows: xcode: latest cocoapods: default scripts: + - sed -i'.bak' -e 's/isRelease = true/isRelease = false/g' lib/main.dart - | # set up debug keystore rm -f ~/.android/debug.keystore @@ -88,19 +95,34 @@ workflows: echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties" - flutter packages pub get - | - #!/bin/sh + # fetch db and sudachi.rs dict wget https://jp.xydustc.me/f/arujisho.db.zip -O db/arujisho.db.zip - sed -i'.bak' -e 's/isRelease = true/isRelease = false/g' lib/main.dart - - flutter build apk --release - - find . -name "Podfile" -execdir pod install \; - - flutter build ios --release --no-codesign + cd sudachi.rs + sh prepare_diczip.sh + cd .. + - | + # install rust + brew install rustup + rustup-init -y + source "$HOME/.cargo/env" + rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android aarch64-apple-ios + cargo install cargo-ndk + - | + # build Android + source "$HOME/.cargo/env" + flutter build apk --release + - | + # build iOS + source "$HOME/.cargo/env" + find . -name "Podfile" -execdir pod install \; + flutter build ios --release --no-codesign - | #!/bin/sh mv build/app/outputs/apk/release/app-release.apk build/app/outputs/apk/release/arujisho.apk mkdir -p Payload mkdir -p build/ios/ipa mv ./build/ios/iphoneos/Runner.app Payload - zip -r -y -0 Payload.zip Payload/Runner.app + zip -r -y -3 Payload.zip Payload/Runner.app mv Payload.zip build/ios/ipa/arujisho.ipa artifacts: - build/**/outputs/apk/**/*.apk diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 8d4492f..9625e10 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bd9ee36..d8980d8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,18 +3,43 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 5A4B403228EE4FC000676B9D /* libsudachi_ffi_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A4B402D28EE4F0000676B9D /* libsudachi_ffi_static.a */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 5A4B402C28EE4F0000676B9D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CA60FABBBEDA84FAB6863CBB; + remoteInfo = "sudachi_ffi-staticlib"; + }; + 5A4B402E28EE4F0000676B9D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CA602C3E891A131743C7E4D3; + remoteInfo = "sudachi_ffi-cdylib"; + }; + 5A4B403028EE4F9000676B9D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = CA60FABBBEDA9C324205F5D1; + remoteInfo = "sudachi_ffi-staticlib"; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -32,6 +57,7 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "sudachi-ffi.xcodeproj"; path = "../../sudachi.rs/sudachi-ffi/sudachi-ffi.xcodeproj"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -49,12 +75,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5A4B403228EE4FC000676B9D /* libsudachi_ffi_static.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5A4B402828EE4F0000676B9D /* Products */ = { + isa = PBXGroup; + children = ( + 5A4B402D28EE4F0000676B9D /* libsudachi_ffi_static.a */, + 5A4B402F28EE4F0000676B9D /* sudachi_ffi.dylib */, + ); + name = Products; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -86,6 +122,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -115,6 +152,7 @@ buildRules = ( ); dependencies = ( + 5A4B403128EE4F9000676B9D /* PBXTargetDependency */, ); name = Runner; productName = Runner; @@ -147,6 +185,12 @@ mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 5A4B402828EE4F0000676B9D /* Products */; + ProjectRef = 5A4B402728EE4F0000676B9D /* sudachi-ffi.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, @@ -154,6 +198,23 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 5A4B402D28EE4F0000676B9D /* libsudachi_ffi_static.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libsudachi_ffi_static.a; + remoteRef = 5A4B402C28EE4F0000676B9D /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5A4B402F28EE4F0000676B9D /* sudachi_ffi.dylib */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.dylib"; + path = sudachi_ffi.dylib; + remoteRef = 5A4B402E28EE4F0000676B9D /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -211,6 +272,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 5A4B403128EE4F9000676B9D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "sudachi_ffi-staticlib"; + targetProxy = 5A4B403028EE4F9000676B9D /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; diff --git a/sudachi.rs/sudachi-ffi/sudachi-ffi.xcodeproj/project.pbxproj b/sudachi.rs/sudachi-ffi/sudachi-ffi.xcodeproj/project.pbxproj new file mode 100644 index 0000000..006fc10 --- /dev/null +++ b/sudachi.rs/sudachi-ffi/sudachi-ffi.xcodeproj/project.pbxproj @@ -0,0 +1,371 @@ +// !$*UTF8*$! +{ + /* generated with cargo-xcode 1.5.0 */ + archiveVersion = 1; + classes = { + }; + objectVersion = 53; + objects = { +/* Begin PBXBuildFile section */ + + CA60DF53A78F9C324205F5D1 /* Cargo.toml in Sources */ = { + isa = PBXBuildFile; + fileRef = CA60829325813EF4668187A5 /* Cargo.toml */; + settings = { + COMPILER_FLAGS = "--lib"; /* == OTHER_INPUT_FILE_FLAGS */ + }; + }; + + CA60DF53A78FD1961649E7DE /* Cargo.toml in Sources */ = { + isa = PBXBuildFile; + fileRef = CA60829325813EF4668187A5 /* Cargo.toml */; + settings = { + COMPILER_FLAGS = "--lib"; /* == OTHER_INPUT_FILE_FLAGS */ + }; + }; + +/* End PBXBuildFile section */ + +/* Begin PBXBuildRule section */ + CA6082932581AC6C1400ACA8 /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + dependencyFile = "$(DERIVED_FILE_DIR)/$(CARGO_XCODE_TARGET_ARCH)-$(EXECUTABLE_NAME).d"; + filePatterns = "*/Cargo.toml"; /* must contain asterisk */ + 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.5.0\n\nset -eu; export PATH=\"$PATH:$HOME/.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 */ + + CA60FABBBEDA84FAB6863CBB /* staticlib */ = { + isa = PBXFileReference; + explicitFileType = "archive.ar"; + includeInIndex = 0; + name = "libsudachi_ffi_static.a"; + sourceTree = TARGET_BUILD_DIR; + }; + CA602C3E891A131743C7E4D3 /* cdylib */ = { + isa = PBXFileReference; + explicitFileType = "compiled.mach-o.dylib"; + includeInIndex = 0; + name = "sudachi_ffi.dylib"; + sourceTree = TARGET_BUILD_DIR; + }; + CA60829325813EF4668187A5 /* Cargo.toml */ = { + isa = PBXFileReference; + lastKnownFileType = text; + fileEncoding = 4; + name = "Cargo.toml"; + path = "Cargo.toml"; + sourceTree = ""; + }; + /* Rust needs libresolv */ + ADDEDBA66A6E1 = { + isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; + name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; + }; + +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + CA608293258198AF0B5890DB /* Frameworks */ = { + isa = PBXGroup; + children = ( + ADDEDBA66A6E2, + + ); + name = Frameworks; + sourceTree = ""; + }; + + + ADDEDBA66A6E2 /* Required for static linking */ = { + isa = PBXGroup; + children = ( + ADDEDBA66A6E1 + ); + name = "Required for static linking"; + sourceTree = ""; + }; + + CA608293258122869D176AE5 /* Products */ = { + isa = PBXGroup; + children = ( + CA60FABBBEDA84FAB6863CBB, +CA602C3E891A131743C7E4D3, + + ); + name = Products; + sourceTree = ""; + }; + + CA6082932581D65BC3C892A8 /* Main */ = { + isa = PBXGroup; + children = ( + CA60829325813EF4668187A5, +CA608293258122869D176AE5, +CA608293258198AF0B5890DB, + + ); + sourceTree = ""; + }; + +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + CA60FABBBEDA9C324205F5D1 /* sudachi_ffi-staticlib */ = { + isa = PBXNativeTarget; + buildConfigurationList = CA60DF1B58699C324205F5D1; + buildPhases = ( + CA606C10B85E9C324205F5D1 /* Sources */, + CA6082932581AF6EBB7F357C /* Universal Binary lipo */, + ); + buildRules = ( + CA6082932581AC6C1400ACA8 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = "sudachi_ffi-staticlib"; + productName = "libsudachi_ffi_static.a"; + productReference = CA60FABBBEDA84FAB6863CBB; + productType = "com.apple.product-type.library.static"; + }; + CA602C3E891AD1961649E7DE /* sudachi_ffi-cdylib */ = { + isa = PBXNativeTarget; + buildConfigurationList = CA60DF1B5869D1961649E7DE; + buildPhases = ( + CA606C10B85ED1961649E7DE /* Sources */, + CA6082932581AF6EBB7F357C /* Universal Binary lipo */, + ); + buildRules = ( + CA6082932581AC6C1400ACA8 /* PBXBuildRule */, + ); + dependencies = ( + ); + name = "sudachi_ffi-cdylib"; + productName = "sudachi_ffi.dylib"; + productReference = CA602C3E891A131743C7E4D3; + productType = "com.apple.product-type.library.dynamic"; + }; + +/* End PBXNativeTarget section */ + + CA606C10B85E9C324205F5D1 = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CA60DF53A78F9C324205F5D1 + ); + runOnlyForDeploymentPostprocessing = 0; + }; + + CA60DF1B58699C324205F5D1 /* staticlib */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CA60D84F557F9C324205F5D1 /* Release */, + CA600D771D909C324205F5D1 /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CA60D84F557F9C324205F5D1 /* staticlib */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "sudachi_ffi_static"; + "CARGO_XCODE_CARGO_FILE_NAME" = "libsudachi_ffi.a"; + "CARGO_XCODE_CARGO_DEP_FILE_NAME" = "libsudachi_ffi.d"; + SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; + SKIP_INSTALL = YES; + INSTALL_GROUP = ""; + INSTALL_MODE_FLAG = ""; + INSTALL_OWNER = ""; + + }; + name = Release; + }; + CA600D771D909C324205F5D1 /* staticlib */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "sudachi_ffi_static"; + "CARGO_XCODE_CARGO_FILE_NAME" = "libsudachi_ffi.a"; + "CARGO_XCODE_CARGO_DEP_FILE_NAME" = "libsudachi_ffi.d"; + SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos"; + SKIP_INSTALL = YES; + INSTALL_GROUP = ""; + INSTALL_MODE_FLAG = ""; + INSTALL_OWNER = ""; + + }; + name = Debug; + };CA606C10B85ED1961649E7DE = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CA60DF53A78FD1961649E7DE + ); + runOnlyForDeploymentPostprocessing = 0; + }; + + CA60DF1B5869D1961649E7DE /* cdylib */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CA60D84F557FD1961649E7DE /* Release */, + CA600D771D90D1961649E7DE /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CA60D84F557FD1961649E7DE /* cdylib */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "sudachi_ffi"; + "CARGO_XCODE_CARGO_FILE_NAME" = "libsudachi_ffi.dylib"; + "CARGO_XCODE_CARGO_DEP_FILE_NAME" = "libsudachi_ffi.d"; + SUPPORTED_PLATFORMS = "macosx"; + + DYLIB_COMPATIBILITY_VERSION = "0"; + }; + name = Release; + }; + CA600D771D90D1961649E7DE /* cdylib */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "sudachi_ffi"; + "CARGO_XCODE_CARGO_FILE_NAME" = "libsudachi_ffi.dylib"; + "CARGO_XCODE_CARGO_DEP_FILE_NAME" = "libsudachi_ffi.d"; + SUPPORTED_PLATFORMS = "macosx"; + + DYLIB_COMPATIBILITY_VERSION = "0"; + }; + name = Debug; + }; + + CA6082932581AF6EBB7F357C /* LipoScript */ = { + name = "Universal Binary lipo"; + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = (); + inputFileListPaths = (); + inputPaths = ( + "$(DERIVED_FILE_DIR)/$(ARCHS)-$(EXECUTABLE_NAME).xcfilelist", + ); + outputFileListPaths = (); + outputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)" + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# generated with cargo-xcode 1.5.0\n\n set -eux; cat \"$DERIVED_FILE_DIR/$ARCHS-$EXECUTABLE_NAME.xcfilelist\" | tr \'\\n\' \'\\0\' | xargs -0 lipo -create -output \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n if [ ${LD_DYLIB_INSTALL_NAME:+1} ]; then\n install_name_tool -id \"$LD_DYLIB_INSTALL_NAME\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n fi\n "; + }; + + CA608293258180E02D6C7F57 = { + isa = XCConfigurationList; + buildConfigurations = ( + CA60789D748C3CC16B37690B /* Release */, + CA60789D748C228BE02872F8 /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + + CA60789D748C3CC16B37690B = { + isa = XCBuildConfiguration; + buildSettings = { + + ALWAYS_SEARCH_USER_PATHS = NO; + SUPPORTS_MACCATALYST = YES; + CARGO_TARGET_DIR = "$(PROJECT_TEMP_DIR)/cargo_target"; /* for cargo */ + CARGO_XCODE_FEATURES = ""; /* configure yourself */ + "CARGO_XCODE_TARGET_ARCH[arch=arm64*]" = "aarch64"; + "CARGO_XCODE_TARGET_ARCH[arch=x86_64*]" = "x86_64"; /* catalyst adds h suffix */ + "CARGO_XCODE_TARGET_ARCH[arch=i386]" = "i686"; + "CARGO_XCODE_TARGET_OS[sdk=macosx*]" = "darwin"; + "CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*]" = "ios-sim"; + "CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*][arch=x86_64*]" = "ios"; + "CARGO_XCODE_TARGET_OS[sdk=iphoneos*]" = "ios"; + "CARGO_XCODE_TARGET_OS[sdk=appletvsimulator*]" = "tvos"; + "CARGO_XCODE_TARGET_OS[sdk=appletvos*]" = "tvos"; + PRODUCT_NAME = "sudachi-ffi"; + MARKETING_VERSION = "0.0.1"; + CURRENT_PROJECT_VERSION = "0.0"; + SDKROOT = macosx; + + "CARGO_XCODE_BUILD_MODE" = "release"; /* for xcode scripts */ + }; + name = Release; + }; + + CA60789D748C228BE02872F8 = { + isa = XCBuildConfiguration; + buildSettings = { + + ALWAYS_SEARCH_USER_PATHS = NO; + SUPPORTS_MACCATALYST = YES; + CARGO_TARGET_DIR = "$(PROJECT_TEMP_DIR)/cargo_target"; /* for cargo */ + CARGO_XCODE_FEATURES = ""; /* configure yourself */ + "CARGO_XCODE_TARGET_ARCH[arch=arm64*]" = "aarch64"; + "CARGO_XCODE_TARGET_ARCH[arch=x86_64*]" = "x86_64"; /* catalyst adds h suffix */ + "CARGO_XCODE_TARGET_ARCH[arch=i386]" = "i686"; + "CARGO_XCODE_TARGET_OS[sdk=macosx*]" = "darwin"; + "CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*]" = "ios-sim"; + "CARGO_XCODE_TARGET_OS[sdk=iphonesimulator*][arch=x86_64*]" = "ios"; + "CARGO_XCODE_TARGET_OS[sdk=iphoneos*]" = "ios"; + "CARGO_XCODE_TARGET_OS[sdk=appletvsimulator*]" = "tvos"; + "CARGO_XCODE_TARGET_OS[sdk=appletvos*]" = "tvos"; + PRODUCT_NAME = "sudachi-ffi"; + MARKETING_VERSION = "0.0.1"; + CURRENT_PROJECT_VERSION = "0.0"; + SDKROOT = macosx; + + "CARGO_XCODE_BUILD_MODE" = "debug"; /* for xcode scripts */ + ONLY_ACTIVE_ARCH = YES; + }; + name = Debug; + }; + + CA6082932581E04653AD465F = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + TargetAttributes = { + CA60FABBBEDA9C324205F5D1 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + CA602C3E891AD1961649E7DE = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = CA608293258180E02D6C7F57; + compatibilityVersion = "Xcode 11.4"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = CA6082932581D65BC3C892A8; + productRefGroup = CA608293258122869D176AE5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CA60FABBBEDA9C324205F5D1, +CA602C3E891AD1961649E7DE, + + ); + }; + + }; + rootObject = CA6082932581E04653AD465F; +} + \ No newline at end of file diff --git a/sudachi.rs/sudachi/src/plugin/loader.rs b/sudachi.rs/sudachi/src/plugin/loader.rs index 67ebe11..70ed671 100644 --- a/sudachi.rs/sudachi/src/plugin/loader.rs +++ b/sudachi.rs/sudachi/src/plugin/loader.rs @@ -72,6 +72,10 @@ fn make_system_specific_name(s: &str) -> String { format!("lib{}.dylib", s) } +#[cfg(target_os = "ios")] +fn make_system_specific_name(s: &str) -> String { + format!("lib{}.dylib", s) +} fn system_specific_name(s: &str) -> Option { if s.contains('.') { None