Commit Graph

8 Commits

Author SHA1 Message Date
Brad King
5ec87b2ba7 Emscripten: Provide CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID
Extend commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16,
v4.2.0-rc1~607^2~3) to account for commit 7f0f382c55 (Provide
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID on more compilers, 2025-03-24,
v4.1.0-rc1~499^2).

Fixes: #27425
2025-11-25 15:46:16 -05:00
Brad King
27cc5d58bf Tests/RunCMake/Emscripten: Add tests covering try_compile COPY_FILE
Compiler inspection relies on `try_compile`'s `COPY_FILE` option to copy
the `.wasm` file because the `.js` does not have the `INFO:size` string.

Issue: #27421
2025-11-25 15:45:24 -05:00
Brad King
d361bf365e Emscripten: Drop hard-coded -sMAIN_MODULE and -sSIDE_MODULE flags
These flags are only needed for builds involving shared libraries,
and can cause undesirable behavior when they are not needed.
They also have variants with values like `=2`.  For now, just require
projects to add the flags when needed so they have full control.
In the future we may be able to add an abstraction to control them,
and automatically enable them when linking to shared libraries
or creating them.

Fixes: #27232
Issue: #27240
2025-09-19 09:54:02 -04:00
Brad King
8580c6bd8d Tests: Teach RunCMake.Emscripten to tolerate emcc cache output
`emcc` may generate messages like `cache:INFO:` to stderr,
which we otherwise expect to be empty.
2025-09-19 09:21:33 -04:00
Brad King
9cbeb922dd Emscripten: Enable de-duplication of libraries for CMP0156 with LLD
LLD automatically resolves newly encountered symbols using object files
previously encountered.  Also, the Emscripten compiler driver invokes
the LLD linker with `--whole-archive ... --no-whole-archive` around all
the libraries.  Therefore we should not repeat any.

Issue: #27232
Suggested-by: Marc Chevrier <marc.chevrier@gmail.com>
2025-09-17 19:44:13 -04:00
Brad King
28bab611c6 Tests: Add RunCMake.Emscripten case for a shared library 2025-09-17 19:43:36 -04:00
Brad King
d3e9c7bf8a Tests: Clarify RunCMake.Emscripten case names 2025-09-17 19:41:16 -04:00
Quinn Powell
c6da668b13 Emscripten: Add tests for the Emscripten toolchain 2025-06-17 15:07:45 -04:00