Skip to content

Commit f638f55

Browse files
committed
Add wasm32-emscripten-pthread-release overlay triplet
1 parent 8deeb90 commit f638f55

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH)
2+
3+
if(NOT DEFINED ENV{EMSCRIPTEN_ROOT})
4+
find_path(EMSCRIPTEN_ROOT "emcc")
5+
else()
6+
set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}")
7+
endif()
8+
9+
if(NOT EMSCRIPTEN_ROOT)
10+
if(NOT DEFINED ENV{EMSDK})
11+
message(FATAL_ERROR "The emcc compiler not found in PATH")
12+
endif()
13+
set(EMSCRIPTEN_ROOT "$ENV{EMSDK}/upstream/emscripten")
14+
endif()
15+
16+
if(NOT EXISTS "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
17+
message(FATAL_ERROR "Emscripten.cmake toolchain file not found")
18+
endif()
19+
20+
set(VCPKG_TARGET_ARCHITECTURE wasm32)
21+
set(VCPKG_CRT_LINKAGE dynamic)
22+
set(VCPKG_LIBRARY_LINKAGE static)
23+
set(VCPKG_CMAKE_SYSTEM_NAME Emscripten)
24+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
25+
26+
set(ENV{EMCC_CFLAGS} "$ENV{EMCC_CFLAGS} -pthread")
27+
28+
set(VCPKG_BUILD_TYPE release)

0 commit comments

Comments
 (0)