Skip to content

Commit 32a00ea

Browse files
committed
Set -arch flag for clang++ to properly cross-compile for macOS
1 parent 6d73ad7 commit 32a00ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

skiko/buildSrc/src/main/kotlin/tasks/configuration/NativeTasksConfiguration.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ fun SkikoProjectContext.compileNativeBridgesTask(
117117
OS.MacOS -> {
118118
flags.set(listOf(
119119
*buildType.clangFlags,
120-
*skiaPreprocessorFlags(OS.MacOS, buildType)
120+
*skiaPreprocessorFlags(OS.MacOS, buildType),
121+
when(arch) {
122+
Arch.Arm64 -> "-arch arm64"
123+
Arch.X64 -> "-arch x86_64"
124+
else -> error("Unexpected arch: $arch for $os")
125+
}
121126
))
122127
}
123128
OS.Linux -> {

0 commit comments

Comments
 (0)