We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a44d906 commit 1d29ac2Copy full SHA for 1d29ac2
src/SPC/store/scripts/zig-cc.sh
@@ -72,13 +72,21 @@ else
72
status=$?
73
74
if [ $status -eq 0 ]; then
75
- echo "$output"
+ echo "$output" | grep -v "version '.*' in target triple"
76
exit 0
77
fi
78
79
if echo "$output" | grep -q "version '.*' in target triple"; then
80
- echo "$output" | grep -v "version '.*' in target triple"
81
- exit 0
+ TARGET_FALLBACK="${SPC_TARGET}-${SPC_LIBC}"
+ output=$(zig cc -target "$TARGET_FALLBACK" -lstdc++ ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" 2>&1)
82
+ status=$?
83
+
84
+ if [ $status -eq 0 ]; then
85
+ echo "$output"
86
+ exit 0
87
+ else
88
+ exec zig cc -target "$TARGET_FALLBACK" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
89
+ fi
90
else
91
exec zig cc -target "$TARGET" ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
92
0 commit comments