mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 22:51:37 +08:00
Use EMSCRIPTEN_ROOT variable in addition to EMSDK (#24072)
* Use EMSCRIPTEN variable instead of EMSDK Because it's directly point to appropriate version * Use EMSCRIPTEN_ROOT variable in addition to EMSDK
This commit is contained in:
parent
4a41edd67f
commit
9dfc2f05b8
@ -1,10 +1,19 @@
|
||||
set(VCPKG_ENV_PASSTHROUGH EMSDK PATH)
|
||||
set(VCPKG_ENV_PASSTHROUGH_UNTRACKED EMSCRIPTEN_ROOT EMSDK PATH)
|
||||
|
||||
if(NOT DEFINED ENV{EMSDK})
|
||||
message(FATAL_ERROR "The EMSDK environment variable must be defined")
|
||||
if(NOT DEFINED ENV{EMSCRIPTEN_ROOT})
|
||||
find_path(EMSCRIPTEN_ROOT "emcc")
|
||||
else()
|
||||
set(EMSCRIPTEN_ROOT "$ENV{EMSCRIPTEN_ROOT}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake)
|
||||
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()
|
||||
|
||||
@ -12,4 +21,4 @@ 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 $ENV{EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake)
|
||||
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake")
|
||||
|
Loading…
Reference in New Issue
Block a user