Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: E:/Projects/GitHub/waterius-esp32s2/ESP32S2/.pio/build/esp32s2/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Users/Anton/.platformio/packages/tool-ninja/ninja.exe cmTC_50362 && [1/2] Building C object CMakeFiles/cmTC_50362.dir/src.c.obj

[2/2] Linking C executable cmTC_50362

FAILED: cmTC_50362 

cmd.exe /C "cd . && C:\Users\Anton\.platformio\packages\toolchain-xtensa-esp32s2\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls  CMakeFiles/cmTC_50362.dir/src.c.obj -o cmTC_50362   && cd ."

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0x10): warning: pthread_join is not implemented and will always fail

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0x18): warning: pthread_exit is not implemented and will always fail

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0x8): warning: pthread_detach is not implemented and will always fail

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0x4): warning: pthread_create is not implemented and will always fail

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0xc): warning: pthread_cancel is not implemented and will always fail

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj:(.literal+0x4): undefined reference to `pthread_atfork'

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_50362.dir/src.c.obj: in function `main':

src.c:(.text+0x3f): undefined reference to `pthread_atfork'

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.



Source file was:
#include <pthread.h>

static void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: E:/Projects/GitHub/waterius-esp32s2/ESP32S2/.pio/build/esp32s2/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Users/Anton/.platformio/packages/tool-ninja/ninja.exe cmTC_19aa6 && [1/2] Building C object CMakeFiles/cmTC_19aa6.dir/CheckFunctionExists.c.obj

[2/2] Linking C executable cmTC_19aa6

FAILED: cmTC_19aa6 

cmd.exe /C "cd . && C:\Users\Anton\.platformio\packages\toolchain-xtensa-esp32s2\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls  -DCHECK_FUNCTION_EXISTS=pthread_create  CMakeFiles/cmTC_19aa6.dir/CheckFunctionExists.c.obj -o cmTC_19aa6  -lpthreads && cd ."

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: cannot find -lpthreads: No such file or directory

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_19aa6.dir/CheckFunctionExists.c.obj:(.literal+0x0): warning: pthread_create is not implemented and will always fail

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.




Determining if the function pthread_create exists in the pthread failed with the following output:
Change Dir: E:/Projects/GitHub/waterius-esp32s2/ESP32S2/.pio/build/esp32s2/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Users/Anton/.platformio/packages/tool-ninja/ninja.exe cmTC_4cd46 && [1/2] Building C object CMakeFiles/cmTC_4cd46.dir/CheckFunctionExists.c.obj

[2/2] Linking C executable cmTC_4cd46

FAILED: cmTC_4cd46 

cmd.exe /C "cd . && C:\Users\Anton\.platformio\packages\toolchain-xtensa-esp32s2\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls  -DCHECK_FUNCTION_EXISTS=pthread_create  CMakeFiles/cmTC_4cd46.dir/CheckFunctionExists.c.obj -o cmTC_4cd46  -lpthread && cd ."

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: cannot find -lpthread: No such file or directory

c:/users/anton/.platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/12.2.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: CMakeFiles/cmTC_4cd46.dir/CheckFunctionExists.c.obj:(.literal+0x0): warning: pthread_create is not implemented and will always fail

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.




Determining if compiler accepts -pthread failed with the following output:
Change Dir: E:/Projects/GitHub/waterius-esp32s2/ESP32S2/.pio/build/esp32s2/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Users/Anton/.platformio/packages/tool-ninja/ninja.exe cmTC_afdcf && [1/2] Building C object CMakeFiles/cmTC_afdcf.dir/CheckForPthreads.c.obj

[2/2] Linking C executable cmTC_afdcf

FAILED: cmTC_afdcf 

cmd.exe /C "cd . && C:\Users\Anton\.platformio\packages\toolchain-xtensa-esp32s2\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls  CMakeFiles/cmTC_afdcf.dir/CheckForPthreads.c.obj -o cmTC_afdcf  -pthread && cd ."

xtensa-esp32s2-elf-gcc.exe: error: unrecognized command-line option '-pthread'
ninja: build stopped: subcommand failed.




