File: features.cmake

package info (click to toggle)
rust-wasmtime 26.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 48,492 kB
  • sloc: ansic: 4,003; sh: 561; javascript: 542; cpp: 254; asm: 175; ml: 96; makefile: 55
file content (45 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download
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