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.
compilers :=
# Other backends to enable in the build phase (not while testing)
build_compilers :=
##
# Cranelift
##
@ -217,21 +220,12 @@ endif
ifneq ($(ENABLE_V8), 0)
# … then maybe the user forced to enable the V8 compiler.
ifeq ($(ENABLE_V8), 1)
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
build_compilers += v8
endif
# we don't check automatically for now
endif
ifneq (, $(findstring v8,$(compilers)))
ifneq (, $(findstring v8,$(build_compilers)))
ENABLE_V8 := 1
endif
@ -243,21 +237,12 @@ endif
ifneq ($(ENABLE_WAMR), 0)
# … then maybe the user forced to enable the WAMR compiler.
ifeq ($(ENABLE_WAMR), 1)
compilers += wamr
# … otherwise, we try to check whether WAMR works on this host.
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
build_compilers += wamr
# we don't check automatically for now
endif
endif
ifneq (, $(findstring wamr,$(compilers)))
ifneq (, $(findstring wamr,$(build_compilers)))
ENABLE_WAMR := 1
endif
@ -266,25 +251,16 @@ endif
##
# 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.
ifeq ($(ENABLE_wasmi), 1)
compilers += wasmi
# … otherwise, we try to check whether wasmi works on this host.
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
ifeq ($(ENABLE_WASMI), 1)
build_compilers += wasmi
# we don't check automatically for now
endif
endif
ifneq (, $(findstring wasmi,$(compilers)))
ENABLE_wasmi := 1
ifneq (, $(findstring wasmi,$(build_compilers)))
ENABLE_WASMI := 1
endif
@ -293,6 +269,7 @@ endif
##
compilers := $(strip $(compilers))
build_compilers := $(strip $(build_compilers) $(compilers))
#####
@ -363,6 +340,7 @@ comma := ,
# 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
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 :=
# 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)
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:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="v8" --bin wasmer --locked