Raise wasi-sdk to 25 and wabt to 1.0.37 (#4187)
Raise wasi-sdk to 25 and wabt to 1.0.37. It includes - Refactor CI workflow to install WASI-SDK and WABT from a composite action - Use ExternalProject to bring wasm-apps for few samples. file/ wasi-threads/ - Refactor sample build and test steps in SGX compilation workflow for improved clarity and efficiency (workaround) Add CMake support for EMSCRIPTEN and WAMRC, update module paths
This commit is contained in:
45
samples/cmake/FindEMSCRIPTEN.cmake
Normal file
45
samples/cmake/FindEMSCRIPTEN.cmake
Normal file
@ -0,0 +1,45 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(EMSCRIPTEN_HOME
|
||||
NAMES upstream/emscripten
|
||||
PATHS /opt/emsdk
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
find_file(EMSCRIPTEN_VERSION_FILE
|
||||
NAMES emscripten-version.txt
|
||||
PATHS ${EMSCRIPTEN_HOME}/upstream/emscripten
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
file(READ ${EMSCRIPTEN_VERSION_FILE} EMSCRIPTEN_VERSION_FILE_CONTENT)
|
||||
|
||||
string(REGEX
|
||||
MATCH
|
||||
"[0-9]+\.[0-9]+(\.[0-9]+)*"
|
||||
EMSCRIPTEN_VERSION
|
||||
${EMSCRIPTEN_VERSION_FILE_CONTENT}
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(EMSCRIPTEN
|
||||
REQUIRED_VARS EMSCRIPTEN_HOME
|
||||
VERSION_VAR EMSCRIPTEN_VERSION
|
||||
HANDLE_VERSION_RANGE
|
||||
)
|
||||
|
||||
if(EMSCRIPTEN_FOUND)
|
||||
set(EMSCRIPTEN_TOOLCHAIN ${EMSCRIPTEN_HOME}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake)
|
||||
set(EMCC ${EMSCRIPTEN_HOME}/upstream/emscripten/emcc)
|
||||
endif()
|
||||
mark_as_advanced(EMSCRIPTEN_TOOLCHAIN EMCC)
|
||||
27
samples/cmake/FindWAMRC.cmake
Normal file
27
samples/cmake/FindWAMRC.cmake
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(WAMRC_HOME
|
||||
wamr-compiler
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../../..
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
find_file(WAMRC_BIN
|
||||
wamrc
|
||||
HINTS ${WAMRC_HOME}/wamr-compiler/build
|
||||
NO_DEFAULT_PATH
|
||||
NO_CMAKE_PATH
|
||||
NO_CMAKE_SYSTEM_PATH
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(WAMRC REQUIRED_VARS WAMRC_BIN)
|
||||
mark_as_advanced(WAMRC_BIN)
|
||||
25
samples/cmake/FindWASISDK.cmake
Normal file
25
samples/cmake/FindWASISDK.cmake
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
file(GLOB WASISDK_SEARCH_PATH "/opt/wasi-sdk-*")
|
||||
find_path(WASISDK_HOME
|
||||
NAMES share/wasi-sysroot
|
||||
PATHS ${WASISDK_SEARCH_PATH}
|
||||
NO_DEFAULT_PATH
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
string(REGEX MATCH [0-9]+\.[0-9]+\.*[0-9]* WASISDK_VERSION ${WASISDK_HOME})
|
||||
|
||||
find_package_handle_standard_args(WASISDK REQUIRED_VARS WASISDK_HOME VERSION_VAR WASISDK_VERSION)
|
||||
|
||||
if(WASISDK_FOUND)
|
||||
set(WASISDK_CC_COMMAND ${WASISDK_HOME}/bin/clang)
|
||||
set(WASISDK_CXX_COMMAND ${WASISDK_HOME}/bin/clang++)
|
||||
set(WASISDK_TOOLCHAIN ${WASISDK_HOME}/share/cmake/wasi-sdk.cmake)
|
||||
set(WASISDK_PTHREAD_TOOLCHAIN ${WASISDK_HOME}/share/cmake/wasi-sdk-pthread.cmake)
|
||||
set(WASISDK_SYSROOT ${WASISDK_HOME}/share/wasi-sysroot)
|
||||
endif()
|
||||
mark_as_advanced(WASISDK_CC_COMMAND WASISDK_CXX_COMMAND WASISDK_TOOLCHAIN WASISDK_PTHREAD_TOOLCHAIN WASISDK_SYSROOT WASISDK_HOME)
|
||||
Reference in New Issue
Block a user