|
|
@@ -169,12 +169,12 @@ else()
|
|
|
endif()
|
|
|
|
|
|
set(SDL_ASSEMBLY_DEFAULT OFF)
|
|
|
-if(USE_CLANG OR USE_GCC OR USE_INTELCC OR MSVC_VERSION GREATER 1400)
|
|
|
+if(USE_CLANG OR USE_GCC OR USE_INTELCC OR USE_TCC OR MSVC_VERSION GREATER 1400)
|
|
|
set(SDL_ASSEMBLY_DEFAULT ON)
|
|
|
endif()
|
|
|
|
|
|
set(SDL_GCC_ATOMICS_DEFAULT OFF)
|
|
|
-if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
|
|
+if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC OR TCC)
|
|
|
set(SDL_GCC_ATOMICS_DEFAULT ON)
|
|
|
endif()
|
|
|
|
|
|
@@ -463,7 +463,10 @@ if(SDL_SHARED)
|
|
|
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
|
|
|
target_compile_features(SDL3-shared PRIVATE c_std_99)
|
|
|
else()
|
|
|
- message(WARNING "target_compile_features does not know c_std_99 for C compiler")
|
|
|
+ # tcc does support the subset of C99 used by SDL
|
|
|
+ if (NOT USE_TCC)
|
|
|
+ message(WARNING "target_compile_features does not know c_std_99 for C compiler")
|
|
|
+ endif()
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
@@ -476,7 +479,9 @@ if(SDL_STATIC)
|
|
|
if ("c_std_99" IN_LIST CMAKE_C_COMPILE_FEATURES)
|
|
|
target_compile_features(SDL3-static PRIVATE c_std_99)
|
|
|
else()
|
|
|
- message(WARNING "target_compile_features does not know c_std_99 for C compiler")
|
|
|
+ if (NOT USE_TCC)
|
|
|
+ message(WARNING "target_compile_features does not know c_std_99 for C compiler")
|
|
|
+ endif()
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
@@ -510,7 +515,10 @@ check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT)
|
|
|
if(HAVE_WL_VERSION_SCRIPT)
|
|
|
sdl_shared_link_options("-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym")
|
|
|
else()
|
|
|
- if((LINUX AND LIBC_IS_GLIBC) OR ANDROID)
|
|
|
+ # When building with tcc on Linux+glibc or Android, avoid emitting an error
|
|
|
+ # for lack of support of the version-script linker flag: the option will be
|
|
|
+ # silently ignored by the compiler and the build will still succeed.
|
|
|
+ if(((LINUX AND LIBC_IS_GLIBC) OR ANDROID) AND (NOT USE_TCC))
|
|
|
message(FATAL_ERROR "Linker does not support '-Wl,--version-script=xxx.sym'. This is required on the current host platform (${SDL_CMAKE_PLATFORM}).")
|
|
|
endif()
|
|
|
endif()
|