Browse Source

build, Makefile: remove --feature if none is present

If we don't pass in FEATURES or SMP, we will have no feature enabled. In
this scenerio, the dangling --feature argument will cause cargo to panic.

We provide the features and the --feature together to avoid this...

Signed-off-by: greatbridf <greatbridf@icloud.com>
greatbridf 6 months ago
parent
commit
5ada0d0634
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Makefile.src

+ 9 - 1
Makefile.src

@@ -22,7 +22,15 @@ KERNEL_CARGO_MANIFESTS += $(shell find src macros crates -name Cargo.toml -type
 KERNEL_DEPS := $(KERNEL_SOURCES) $(KERNEL_CARGO_MANIFESTS)
 
 QEMU_ARGS ?= -no-reboot
-CARGO_FLAGS := --profile $(PROFILE) --features $(FEATURES)$(if $(SMP),$(COMMA)smp,)
+CARGO_FLAGS := --profile $(PROFILE)
+
+ifneq ($(SMP),)
+CARGO_FLAGS += --features smp
+endif
+
+ifneq ($(FEATURES),)
+CARGO_FLAGS += --features $(FEATURES)
+endif
 
 ifeq ($(HOST),darwin)
 QEMU_ACCEL ?= -accel tcg