Add support for tcc to cmake (#14464)

This PR adds support to the cmake build scripts so to allow building SDL with the Tiny C Compiler (tcc).

TinyCC supports the subset of C99 used by SDL and will complete the build once the --version-script linker flag is removed. The changes have been tested with various build configurations, including X11 and Wayland, and using tcc version 0.9.28rc 2025-10-27 mob@f4e01bfc on x86_64 Linux.
This commit is contained in:
tsst-tsst
2025-11-15 20:24:15 +01:00
committed by GitHub
parent 005cb20e67
commit d4bef0d5ba
4 changed files with 23 additions and 8 deletions

View File

@@ -91,7 +91,7 @@ bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
: "cc", "memory");
return result == 0;
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#elif (defined(__GNUC__) || defined(__TINYC__)) && (defined(__i386__) || defined(__x86_64__))
int result;
__asm__ __volatile__(
"lock ; xchgl %0, (%1)\n"