forked from WebAssembly/wasi-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8827cdf
commit d7427b2
Showing
38 changed files
with
775 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Build logic for building both a toolchain and a sysroot for WASI. | ||
# | ||
# This top level `CMakeLists.txt` file can be used either to build a clang | ||
# toolchain or a WASI sysroot. Note that this can't be done at the same time. | ||
# A toolchain build requires a compiler for the target architecture. A | ||
# WASI sysroot build requires this previous compiler and must be runnable on | ||
# the host. | ||
|
||
cmake_minimum_required(VERSION 3.26) | ||
project(wasi-sdk) | ||
include(ExternalProject) | ||
|
||
set(WASI_SDK_TARGETS "wasm32-wasi;wasm32-wasip1;wasm32-wasip2;wasm32-wasip1-threads;wasm32-wasi-threads" | ||
CACHE STRING "List of WASI targets to build") | ||
option(WASI_SDK_BUILD_TOOLCHAIN "Build a toolchain instead of the sysroot" OFF) | ||
|
||
set(llvm_proj_dir ${CMAKE_CURRENT_SOURCE_DIR}/src/llvm-project) | ||
set(wasi_libc ${CMAKE_CURRENT_SOURCE_DIR}/src/wasi-libc) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
include(wasi-sdk-enable-ccache) | ||
|
||
# Set some variables based on the `version.py` script | ||
set(version_script ${CMAKE_CURRENT_SOURCE_DIR}/version.py) | ||
execute_process( | ||
COMMAND ${PYTHON} ${version_script} llvm-major --llvm-dir=${llvm_proj_dir} | ||
OUTPUT_VARIABLE clang_version | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
execute_process( | ||
COMMAND ${PYTHON} ${version_script} | ||
OUTPUT_VARIABLE wasi_sdk_version | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
# Only include one version of the build logic as pulling in both isn't | ||
# supported at this time. | ||
if(WASI_SDK_BUILD_TOOLCHAIN) | ||
include(wasi-sdk-toolchain) | ||
else() | ||
include(wasi-sdk-sysroot) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contributing | ||
|
||
TODO |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.