Skip to content

Commit 39cc91e

Browse files
committedMar 18, 2025··
use clang to compile native on intel mac
1 parent 60890f6 commit 39cc91e

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed
 

‎.github/workflows/release.binaries.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
macos: |
6868
export DTLV_OS=macos
69-
bash script/compile-native
69+
bash script/compile-native-intel-mac
7070
linux: |
7171
export DTLV_OS=linux
7272
bash script/compile-native-linux

‎script/compile-native-intel-mac

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -eou pipefail
4+
5+
if [ -z "$GRAALVM_HOME" ]; then
6+
echo "Please set GRAALVM_HOME"
7+
exit 1
8+
fi
9+
10+
export JAVA_HOME=$GRAALVM_HOME
11+
export PATH=$GRAALVM_HOME/bin:$PATH
12+
13+
echo $JAVA_HOME
14+
15+
args_app=(
16+
"--verbose"
17+
"--native-compiler-path=/usr/local/opt/llvm/bin/clang"
18+
"-jar" "target/main.uberjar.jar"
19+
"-H:Name=dtlv"
20+
)
21+
22+
args_test0=(
23+
"--verbose"
24+
"--native-compiler-path=/usr/local/opt/llvm/bin/clang"
25+
"-jar" "target/test0.uberjar.jar"
26+
"-H:Name=dtlv-test0"
27+
)
28+
29+
lein clean
30+
lein with-profile native-uberjar uberjar
31+
32+
"$GRAALVM_HOME/bin/native-image" "${args_app[@]}"
33+
34+
lein clean
35+
lein with-profile test0-uberjar uberjar
36+
37+
"$GRAALVM_HOME/bin/native-image" "${args_test0[@]}"

0 commit comments

Comments
 (0)
Please sign in to comment.