File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ if(ZMQ_WASM OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
8484 set (VCPKG_HOST_TRIPLET wasm32-emscripten)
8585 set (VCPKG_TARGET_TRIPLET wasm32-emscripten)
8686
87- include ($ENV{EMSCRIPTEN_ROOT} /cmake/Modules/Platform/Emscripten.cmake )
87+ if ("$ENV{EMSCRIPTEN_ROOT} " STREQUAL "" )
88+ find_program (EMCC emcc REQUIRED )
89+ get_filename_component (EMSCRIPTEN_ROOT "${EMCC} " DIRECTORY )
90+ else ()
91+ set (EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT} " )
92+ endif ()
93+
94+ include (${EMSCRIPTEN_ROOT} /cmake/Modules/Platform/Emscripten.cmake )
8895
89- set (CMAKE_LINKER "$ENV {EMSCRIPTEN_ROOT} /bin/lld${CMAKE_EXECUTABLE_SUFFIX} " CACHE STRING "Linker" FORCE )
96+ set (CMAKE_LINKER "${EMSCRIPTEN_ROOT} /bin/lld${CMAKE_EXECUTABLE_SUFFIX} " CACHE STRING "Linker" FORCE )
9097
9198 # export an indirect function table for napi-wasm
9299 add_link_options ("--export-table" )
You can’t perform that action at this time.
0 commit comments