1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
set(WASMTIME_FEATURES "--no-default-features")
option(WASMTIME_DISABLE_ALL_FEATURES
"disable all features by default instead of enabling them"
OFF)
macro(feature rust_name default)
string(TOUPPER "wasmtime_feature_${rust_name}" cmake_name)
string(REPLACE "-" "_" cmake_name ${cmake_name})
if(${default})
if(${WASMTIME_DISABLE_ALL_FEATURES})
set(feature_default OFF)
else()
set(feature_default ON)
endif()
else()
set(feature_default OFF)
endif()
option(${cmake_name} "enable the Cargo feature ${rust_name}" ${feature_default})
if(${cmake_name})
list(APPEND WASMTIME_FEATURES "--features=${rust_name}")
message(STATUS "Enabling feature ${rust_name}")
endif()
endmacro()
# WASMTIME_FEATURE_LIST
feature(profiling ON)
feature(wat ON)
feature(cache ON)
feature(parallel-compilation ON)
feature(wasi ON)
feature(logging ON)
feature(disable-logging OFF)
feature(coredump ON)
feature(addr2line ON)
feature(demangle ON)
feature(threads ON)
feature(gc ON)
feature(async ON)
feature(cranelift ON)
feature(winch ON)
# ... if you add a line above this be sure to change the other locations
# marked WASMTIME_FEATURE_LIST
|