Skip to content

Commit d1f978c

Browse files
committed
Try to fix macOS compilation
1 parent bf2d8c1 commit d1f978c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
path: native/build/libs/UnityTranslateLib-*.jar
7474
build-osx:
7575
environment: UnityTranslate Build
76-
runs-on: macos-latest
76+
runs-on: macos-14
7777

7878
steps:
7979
- uses: actions/checkout@v4

native/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ crate-type = ["cdylib"]
1010
ct2rs = { git = "https://github.com/UnityMultiplayer/ctranslate2-rs.git" }
1111
jni = "0.21.1"
1212
rust_tokenizers = "8.1.1"
13-
anyhow = "1.0.95"
13+
anyhow = "1.0.95"
14+
15+
[features]
16+
accelerate = ["ct2rs/accelerate"]

native/build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,20 @@ tasks {
171171

172172
execOperations.exec {
173173
commandLine(if (target.isHost()) "cargo" else "cross")
174-
args(
174+
175+
val args = mutableListOf(
175176
"build", "--release",
176177
"--target", target.targetName,
177178
"--package", "UnityTranslateLib",
178179
"--lib"
179180
)
181+
182+
if (target.systemName == "osx") {
183+
args.add("-F")
184+
args.add("accelerate")
185+
}
186+
187+
args(args)
180188
standardOutput = System.out
181189
}
182190
.assertNormalExitValue()

0 commit comments

Comments
 (0)