1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

CMake: no pthreads in LWS_PLAT_FREERTOS

This commit is contained in:
Andy Green 2020-04-24 07:56:32 +01:00
parent c95706a17f
commit 2d5662a4f9

View file

@ -1027,21 +1027,21 @@ CHECK_C_SOURCE_COMPILES("#include <stdint.h>
return 0; return 0;
}" LWS_HAS_INTPTR_T) }" LWS_HAS_INTPTR_T)
if (LWS_HAVE_PTHREAD_H) if (LWS_HAVE_PTHREAD_H AND NOT LWS_PLAT_FREERTOS)
if ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) if ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-pthread -Wno-error=unused-command-line-argument") set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-pthread -Wno-error=unused-command-line-argument")
else() else()
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-pthread") set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-pthread")
endif() endif()
CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE
#include <pthread.h> #include <pthread.h>
int main(void) { int main(void) {
pthread_t th = 0; pthread_t th = 0;
pthread_setname_np(th, NULL); pthread_setname_np(th, NULL);
return 0; return 0;
}" LWS_HAS_PTHREAD_SETNAME_NP) }" LWS_HAS_PTHREAD_SETNAME_NP)
endif() endif()
CHECK_C_SOURCE_COMPILES("#include <stddef.h> CHECK_C_SOURCE_COMPILES("#include <stddef.h>
#include <getopt.h> #include <getopt.h>