cmake: Solaris' SunPro has alternative way to link to pthread libraries

Fixes libsdl-org/SDL#10096

(cherry picked from commit 4fbd6cba60)
This commit is contained in:
Anonymous Maarten 2024-12-28 03:46:10 +01:00
parent 96b4535cc7
commit e02f651c05
1 changed files with 5 additions and 1 deletions

View File

@ -963,7 +963,11 @@ macro(CheckPTHREAD)
set(PTHREAD_LDFLAGS "-lpthread") set(PTHREAD_LDFLAGS "-lpthread")
elseif(SOLARIS) elseif(SOLARIS)
set(PTHREAD_CFLAGS "-D_REENTRANT") set(PTHREAD_CFLAGS "-D_REENTRANT")
set(PTHREAD_LDFLAGS "-pthread -lposix4") if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
set(PTHREAD_LDFLAGS "-mt -lpthread")
else()
set(PTHREAD_LDFLAGS "-pthread -lposix4")
endif()
elseif(SYSV5) elseif(SYSV5)
set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread") set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread")
set(PTHREAD_LDFLAGS "") set(PTHREAD_LDFLAGS "")