mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
Emscripten: Restore support for emsdk toolchain file and platform module
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
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
# 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")
|
||||
|
||||
Reference in New Issue
Block a user