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