medvednikov

/

v2 Public
0 commits 0 issues 0 pull requests 0 contributors Discussions Projects CI

committed 56 years ago · View patch
1 files changed +20 -18
.github/workflows/compile_v_with_vtcc.sh +20 -18
@@ -21,25 +21,27 @@ cd ..
21 21
ls -la vtcc/vtcc
22 22
./vtcc/vtcc --version
23 23
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 -
30 24
show "Generate the C file, for the current V version"
31 25
./v -o vlang.c cmd/v
32 26
ls -la vlang.c
33 27
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