aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/triplets/community/wasm32-emscripten.cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/triplets/community/wasm32-emscripten.cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/triplets/community/wasm32-emscripten.cmake')
-rw-r--r--vcpkg/triplets/community/wasm32-emscripten.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/vcpkg/triplets/community/wasm32-emscripten.cmake b/vcpkg/triplets/community/wasm32-emscripten.cmake
new file mode 100644
index 0000000..ece5d8a
--- /dev/null
+++ b/vcpkg/triplets/community/wasm32-emscripten.cmake
@@ -0,0 +1,24 @@
+set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH)
+
+if(NOT DEFINED ENV{EMSCRIPTEN_ROOT})
+ find_path(EMSCRIPTEN_ROOT "emcc")
+else()
+ set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}")
+endif()
+
+if(NOT EMSCRIPTEN_ROOT)
+ if(NOT DEFINED ENV{EMSDK})
+ message(FATAL_ERROR "The emcc compiler not found in PATH")
+ endif()
+ set(EMSCRIPTEN_ROOT "$ENV{EMSDK}/upstream/emscripten")
+endif()
+
+if(NOT EXISTS "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
+ message(FATAL_ERROR "Emscripten.cmake toolchain file not found")
+endif()
+
+set(VCPKG_TARGET_ARCHITECTURE wasm32)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE static)
+set(VCPKG_CMAKE_SYSTEM_NAME Emscripten)
+set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")