SDL2 threading config in ./cmake/sdlchecks.cmake not correct for non-GNU compiler (e.g. SunPro cc)
Within the cmake config script, ./cmake/sdlchecks.cmake, there is a check that decides how to enable pthread support for different platforms. If this check detects a platform of either "Solaris" or "SunOS", it issues set(PTHREAD_LDFLAGS "-pthread -lposix4"). However this is only correct for the GNU toolchain, such as gcc. As a result, configure and CMake will fail trying to find threading support on Solaris 10 1/13 (SPARC), and the build will fail, if it is being compiled with Sun's Solaris Studio 12.4 compilers, for example.
According to the Oracle documentation, the correct way to enabled pthread support is to use -mt -lpthread. Therefore, I suggest that a check be made more sophisticated, such that if GNU is not being used, the command is instead set(PTHREAD_LDFLAGS "-mt -lpthread"). I think there are other places in the CMake scripts that do check for GNU, so this should be trivial to add.
I don't think we should be assuming use of the GNU toolchain because they continue to introduce incompatible, breaking features and flags. FSF is great, but they have become so successful they are almost like Microsoft was in the 90s in that regard.
What is the output of the following, when pasted at the bottom of SDL's cmake script?
message("CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}")
I managed to get CMake 3.14 to work.
CMAKE_C_COMPILER_ID: SunPro
Also, if(SOLARIS) works, too.
We are scoping work for the SDL 3.2.0 release, so please let us know if this is a showstopper for you.