Skip to content

Fix the build for the Emscripten target - #2550

Merged
klayoutmatthias merged 1 commit into
KLayout:masterfrom
pepijndevos:fix-emscripten-build
Nov 14, 2026
Merged

klayoutmatthias merged 1 commit into
KLayout:masterfrom
pepijndevos:fix-emscripten-build

Conversation

@pepijndevos

@pepijndevos pepijndevos commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

tlTimer.cc does not compile for Emscripten: WebAssembly defines neither __linux__ nor __APPLE__, so Timer::memory_size () falls through to the trailing #error Unsupported platform. There is no /proc on that target to read a resident set size from, so it returns 0.

No test: a compile fix for a target the CI does not build. Verified with Emscripten 4.0.9, where the unpatched file fails with error: Unsupported platform and the patched one compiles; a full Python module for Pyodide builds and passes its import tests with it.

Drafted with an AI agent from a working build of KLayout for Pyodide.

tlTimer.cc fails with "#error Unsupported platform" because WebAssembly
defines neither __linux__ nor __APPLE__, and WebAssembly has no /proc to
read a resident set size from, so Timer::memory_size () returns 0 there.
@klayoutmatthias
klayoutmatthias merged commit 573d748 into KLayout:master Nov 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants