mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-29 18:49:03 -06:00
Emscripten provides a combined toolchain file and platform module that
predates CMake upstream support. Since commit 96d9b94a98 (Emscripten:
Add platform modules, 2025-05-16), our `Platform/Emscripten` module is
included instead, suppressing existing behavior for users that set
`CMAKE_TOOLCHAIN_FILE` to the emsdk-provided toolchain file. Restore
the previous behavior by teaching our module to defer to the original
module in that case.
Issue: #27232
16 lines
470 B
CMake
16 lines
470 B
CMake
# Emscripten provides a combined toolchain file and platform module
|
|
# that predates CMake upstream support. Avoid interfering with it.
|
|
if(CMAKE_SYSTEM_VERSION EQUAL 1)
|
|
if(CMAKE_TOOLCHAIN_FILE MATCHES [[/Modules/Platform/Emscripten\.cmake$]])
|
|
include("${CMAKE_TOOLCHAIN_FILE}")
|
|
return()
|
|
endif()
|
|
endif()
|
|
|
|
set(CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH ON)
|
|
|
|
set(CMAKE_SHARED_LIBRARY_SUFFIX ".wasm")
|
|
set(CMAKE_EXECUTABLE_SUFFIX ".js")
|
|
|
|
set(CMAKE_DL_LIBS "")
|