Skip to content

Fix Thread_POSIX not compiling with Emscripten#4986

Merged
matejk merged 2 commits intopocoproject:mainfrom
sirnacnud:emscripten-no-thread
Aug 8, 2025
Merged

Fix Thread_POSIX not compiling with Emscripten#4986
matejk merged 2 commits intopocoproject:mainfrom
sirnacnud:emscripten-no-thread

Conversation

@sirnacnud
Copy link
Copy Markdown
Contributor

When compiling Thread_POSIX.cpp with emscripten on macOS, it fails, as it was trying to include sys/prctl.h which is a Linux only header file.

Emscripten currently doesn't have support for getting/setting the thread name, so I decided to use the POCO_NO_THREADNAME define to disable the thread name functionality which can't compile.

The current emscripten build on the CI is built with Ubuntu, which is why this issue didn't appear on the CI.

Changes:

  • I wrapped the sys/prctl.h include in Thread_POSIX.cpp to only be included when POCO_NO_THREADNAME is not defined.
  • Changed Foundation CMakeLists.txt to automatically define POCO_NO_THREADNAME for emscripten.

@matejk matejk added this to the Release 1.15.0 milestone Aug 8, 2025
@matejk matejk merged commit 5f998cb into pocoproject:main Aug 8, 2025
36 checks passed
@sirnacnud sirnacnud deleted the emscripten-no-thread branch August 11, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants