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(wasi-http ON) 35feature(logging ON) 36feature(disable-logging OFF) 37feature(coredump ON) 38feature(addr2line ON) 39feature(demangle ON) 40feature(threads ON) 41feature(gc ON) 42feature(gc-drc ON) 43feature(gc-null ON) 44feature(async ON) 45feature(cranelift ON) 46feature(winch ON) 47feature(debug-builtins ON) 48feature(pooling-allocator ON) 49feature(component-model ON) 50feature(pulley ON) 51feature(all-arch OFF) 52# ... if you add a line above this be sure to change the other locations 53# marked WASMTIME_FEATURE_LIST 54