Skip to content

Commit

Permalink
Disable LTO for macos
Browse files Browse the repository at this point in the history
It is currently not supported by zig.

See ziglang/zig#8680
  • Loading branch information
avdv committed Mar 1, 2024
1 parent 83adb22 commit 4871b90
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/crosscompile
Expand Up @@ -9,14 +9,22 @@ declare -ar TARGETS=(
aarch64-macos-none
)

export SCALANATIVE_MODE="release-full"; # {debug, release-fast, release-full}
export SCALANATIVE_LTO="thin"; # {none, full, thin}

sbt -client 'project scalalsNative'

# Mode: {debug, release-fast, release-full, release-size}

sbt -client 'set nativeConfig ~= { _.withMode(scala.scalanative.build.Mode.releaseFull) }'
sbt -client 'ninjaCompile'

for target in "${TARGETS[@]}"; do
# LTO: {none, full, thin}
case "$target" in
# zig ld does not yet support LTO for mach-O see https://github.com/ziglang/zig/issues/8680
*macos*) LTO=none ;;
*) LTO=full ;;
esac
echo "BUILD - $target"
sbt -client "set nativeConfig ~= { _.withLTO(scala.scalanative.build.LTO.$LTO) }"
sbt -client "set targetTriplet := Some(\"$target\")"
sbt -client "ninja"
ninja -f native/target/scala-3.3.1/native/build.ninja
Expand Down

0 comments on commit 4871b90

Please sign in to comment.