Skip to content

Commit 0ef6ddd

Browse files
committed
ci: vtcc macOS test compiles to object (no Mach-O/ARM64 backend yet)
1 parent ba60fc2 commit 0ef6ddd

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

‎.github/workflows/compile_v_with_vtcc.sh‎

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,27 @@ cd ..
2121
ls -la vtcc/vtcc
2222
./vtcc/vtcc --version
2323

24-
if [[ "$(uname)" == "Darwin" ]]; then
25-
show "macOS: vtcc built successfully (TCC cannot target ARM64, skipping full test)"
26-
rm -rf vtcc/
27-
exit 0
28-
fi
29-
3024
show "Generate the C file, for the current V version"
3125
./v -o vlang.c cmd/v
3226
ls -la vlang.c
3327

34-
show "Compile the C file with vtcc"
35-
./vtcc/vtcc -o v_compiled_with_vtcc vlang.c -lpthread
36-
ls -la v_compiled_with_vtcc
37-
38-
show "Test the resulting V compiler"
39-
./v_compiled_with_vtcc version
40-
41-
show "Compile and run hello with vtcc"
42-
./v_compiled_with_vtcc -cc vtcc/vtcc -showcc run examples/hello_world.v
43-
44-
show "Remove the generated temporary files, so the script can be re-run cleanly"
45-
rm -rf v_compiled_with_vtcc vlang.c vtcc/
28+
if [[ "$(uname)" == "Darwin" ]]; then
29+
show "Compile the C file with vtcc (object only, vtcc targets x86_64 ELF)"
30+
SDK_PATH="$(xcrun --show-sdk-path)"
31+
./vtcc/vtcc -c vlang.c -o vlang.o -I"${SDK_PATH}/usr/include"
32+
ls -la vlang.o
33+
rm -rf vlang.o vlang.c vtcc/
34+
else
35+
show "Compile the C file with vtcc"
36+
./vtcc/vtcc -o v_compiled_with_vtcc vlang.c -lpthread
37+
ls -la v_compiled_with_vtcc
38+
39+
show "Test the resulting V compiler"
40+
./v_compiled_with_vtcc version
41+
42+
show "Compile and run hello with vtcc"
43+
./v_compiled_with_vtcc -cc vtcc/vtcc -showcc run examples/hello_world.v
44+
45+
show "Remove the generated temporary files, so the script can be re-run cleanly"
46+
rm -rf v_compiled_with_vtcc vlang.c vtcc/
47+
fi

0 commit comments

Comments
 (0)