From 0ef6ddd8ee75712532e900197304693f6d1496b5 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 17 May 2026 11:19:14 +0300 Subject: [PATCH] ci: vtcc macOS test compiles to object (no Mach-O/ARM64 backend yet) --- .github/workflows/compile_v_with_vtcc.sh | 38 +++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/compile_v_with_vtcc.sh b/.github/workflows/compile_v_with_vtcc.sh index 16b6c62d1..73436a4ab 100755 --- a/.github/workflows/compile_v_with_vtcc.sh +++ b/.github/workflows/compile_v_with_vtcc.sh @@ -21,25 +21,27 @@ cd .. ls -la vtcc/vtcc ./vtcc/vtcc --version -if [[ "$(uname)" == "Darwin" ]]; then - show "macOS: vtcc built successfully (TCC cannot target ARM64, skipping full test)" - rm -rf vtcc/ - exit 0 -fi - show "Generate the C file, for the current V version" ./v -o vlang.c cmd/v ls -la vlang.c -show "Compile the C file with vtcc" -./vtcc/vtcc -o v_compiled_with_vtcc vlang.c -lpthread -ls -la v_compiled_with_vtcc - -show "Test the resulting V compiler" -./v_compiled_with_vtcc version - -show "Compile and run hello with vtcc" -./v_compiled_with_vtcc -cc vtcc/vtcc -showcc run examples/hello_world.v - -show "Remove the generated temporary files, so the script can be re-run cleanly" -rm -rf v_compiled_with_vtcc vlang.c vtcc/ +if [[ "$(uname)" == "Darwin" ]]; then + show "Compile the C file with vtcc (object only, vtcc targets x86_64 ELF)" + SDK_PATH="$(xcrun --show-sdk-path)" + ./vtcc/vtcc -c vlang.c -o vlang.o -I"${SDK_PATH}/usr/include" + ls -la vlang.o + rm -rf vlang.o vlang.c vtcc/ +else + show "Compile the C file with vtcc" + ./vtcc/vtcc -o v_compiled_with_vtcc vlang.c -lpthread + ls -la v_compiled_with_vtcc + + show "Test the resulting V compiler" + ./v_compiled_with_vtcc version + + show "Compile and run hello with vtcc" + ./v_compiled_with_vtcc -cc vtcc/vtcc -showcc run examples/hello_world.v + + show "Remove the generated temporary files, so the script can be re-run cleanly" + rm -rf v_compiled_with_vtcc vlang.c vtcc/ +fi -- 2.39.5