chore: Update makefile not to enable automatically c_api backends

This commit is contained in:
Edoardo Marangoni
2025-02-14 16:51:11 +01:00
parent 04430fc927
commit ab07438141

View File

@ -121,6 +121,9 @@ ENABLE_WASMI ?=
# Which compilers we build. These have dependencies that may not be on the system. # Which compilers we build. These have dependencies that may not be on the system.
compilers := compilers :=
# Other backends to enable in the build phase (not while testing)
build_compilers :=
## ##
# Cranelift # Cranelift
## ##
@ -217,21 +220,12 @@ endif
ifneq ($(ENABLE_V8), 0) ifneq ($(ENABLE_V8), 0)
# … then maybe the user forced to enable the V8 compiler. # … then maybe the user forced to enable the V8 compiler.
ifeq ($(ENABLE_V8), 1) ifeq ($(ENABLE_V8), 1)
compilers += v8 build_compilers += v8
# … otherwise, we try to check whether V8 works on this host.
else ifneq (, $(filter 1, $(IS_DARWIN) $(IS_LINUX) $(IS_FREEBSD) $(IS_WINDOWS)))
ifeq ($(IS_AMD64), 1)
compilers += v8
endif
ifeq ($(IS_AARCH64), 1)
ifneq ($(IS_WINDOWS), 1)
compilers += v8
endif
endif
endif endif
# we don't check automatically for now
endif endif
ifneq (, $(findstring v8,$(compilers))) ifneq (, $(findstring v8,$(build_compilers)))
ENABLE_V8 := 1 ENABLE_V8 := 1
endif endif
@ -243,21 +237,12 @@ endif
ifneq ($(ENABLE_WAMR), 0) ifneq ($(ENABLE_WAMR), 0)
# … then maybe the user forced to enable the WAMR compiler. # … then maybe the user forced to enable the WAMR compiler.
ifeq ($(ENABLE_WAMR), 1) ifeq ($(ENABLE_WAMR), 1)
compilers += wamr build_compilers += wamr
# … otherwise, we try to check whether WAMR works on this host. # we don't check automatically for now
else ifneq (, $(filter 1, $(IS_DARWIN) $(IS_LINUX) $(IS_FREEBSD) $(IS_WINDOWS)))
ifeq ($(IS_AMD64), 1)
compilers += wamr
endif
ifeq ($(IS_AARCH64), 1)
ifneq ($(IS_WINDOWS), 1)
compilers += wamr
endif
endif
endif endif
endif endif
ifneq (, $(findstring wamr,$(compilers))) ifneq (, $(findstring wamr,$(build_compilers)))
ENABLE_WAMR := 1 ENABLE_WAMR := 1
endif endif
@ -266,25 +251,16 @@ endif
## ##
# If the user didn't disable the wasmi backend… # If the user didn't disable the wasmi backend…
ifneq ($(ENABLE_wasmi), 0) ifneq ($(ENABLE_WASMI), 0)
# … then maybe the user forced to enable the wasmi compiler. # … then maybe the user forced to enable the wasmi compiler.
ifeq ($(ENABLE_wasmi), 1) ifeq ($(ENABLE_WASMI), 1)
compilers += wasmi build_compilers += wasmi
# … otherwise, we try to check whether wasmi works on this host. # we don't check automatically for now
else ifneq (, $(filter 1, $(IS_DARWIN) $(IS_LINUX) $(IS_FREEBSD) $(IS_WINDOWS)))
ifeq ($(IS_AMD64), 1)
compilers += wasmi
endif
ifeq ($(IS_AARCH64), 1)
ifneq ($(IS_WINDOWS), 1)
compilers += wasmi
endif
endif
endif endif
endif endif
ifneq (, $(findstring wasmi,$(compilers))) ifneq (, $(findstring wasmi,$(build_compilers)))
ENABLE_wasmi := 1 ENABLE_WASMI := 1
endif endif
@ -293,6 +269,7 @@ endif
## ##
compilers := $(strip $(compilers)) compilers := $(strip $(compilers))
build_compilers := $(strip $(build_compilers) $(compilers))
##### #####
@ -363,6 +340,7 @@ comma := ,
# Define the compiler Cargo features for all crates. # Define the compiler Cargo features for all crates.
compiler_features := --features $(subst $(space),$(comma),$(compilers)),wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load compiler_features := --features $(subst $(space),$(comma),$(compilers)),wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load
build_compiler_features := --features $(subst $(space),$(comma),$(build_compilers)),wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load
capi_compilers_engines_exclude := capi_compilers_engines_exclude :=
# Define the compiler Cargo features for the C API. It always excludes # Define the compiler Cargo features for the C API. It always excludes
@ -472,7 +450,7 @@ check-capi:
--no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features)
build-wasmer: build-wasmer:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer --locked $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml $(build_compiler_features) --bin wasmer --locked
build-wasmer-v8: build-wasmer-v8:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="v8" --bin wasmer --locked $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="v8" --bin wasmer --locked