Files
CMake/Tests/RunCMake/Emscripten/C-try_run.cmake
T
Brad King a308ea38f3 Emscripten: Fix try_run to run the .js file and not the adjacent .wasm
Since commit 96d9b94a98 (Emscripten: Add platform modules, 2025-05-16,
v4.2.0-rc1~607^2~3) we've considered the `.wasm` to be the `try_compile`
output because we need `COPY_FILE` to get it for extracting `INFO:`
strings during our inspection checks.  This breaks `try_run` because
`node`, used via `CMAKE_CROSSCOMPILING_EMULATOR`, expects the `.js`.
Revert to considering the `.js` to be the primary output file, but
switch to the `.wasm` in `COPY_FILE`'s implementation.

Fixes: #27421
2025-11-25 15:45:46 -05:00

9 lines
229 B
CMake

enable_language(C)
try_run(RUN_RESULT
COMPILE_RESULT
SOURCE_FROM_CONTENT main.c "int main(void) { return 12; }\n"
NO_CACHE
)
message(STATUS "COMPILE_RESULT='${COMPILE_RESULT}'")
message(STATUS "RUN_RESULT='${RUN_RESULT}'")