From 1b7d36fdb02c747f9df9053921d1bea0daff3d5a Mon Sep 17 00:00:00 2001 From: Yohei Ueda Date: Wed, 22 Jun 2022 16:44:24 +0900 Subject: [PATCH] agent: Allow BUILD_TYPE=debug The cargo command creates debug build binaries, when the --release option is not specified. Specifying --debug option causes an error. This patch specifies --release option when BUILD_TYPE=release, and does not specify any build type option when BUILD_TYPE=debug. Fixes #4504 Signed-off-by: Yohei Ueda --- src/agent/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent/Makefile b/src/agent/Makefile index 9d1327c004..533411bee6 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -113,14 +113,14 @@ logging-crate-tests: make -C $(CWD)/../libs/logging $(TARGET_PATH): show-summary - @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES) + @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) $(if $(findstring release,$(BUILD_TYPE)),--release) $(EXTRA_RUSTFEATURES) $(GENERATED_FILES): %: %.in @sed $(foreach r,$(GENERATED_REPLACEMENTS),-e 's|@$r@|$($r)|g') "$<" > "$@" ##TARGET optimize: optimized build optimize: show-summary show-header - @RUSTFLAGS="-C link-arg=-s $(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES) + @RUSTFLAGS="-C link-arg=-s $(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) $(if $(findstring release,$(BUILD_TYPE)),--release) $(EXTRA_RUSTFEATURES) ##TARGET install: install agent install: install-services