From 1dc5a5839c74a55b76a8faba99eeaa2160daab7b Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 19 Nov 2020 11:09:35 -0800 Subject: [PATCH] only add the local-cflags override if we have something to override --- etc/makefiles/sketch.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index ec86524d..a64635e3 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -124,6 +124,12 @@ clean: rm -rf -- "${OUTPUT_PATH}/*" +ifneq ($(LOCAL_CFLAGS),) +local_cflags_property = --build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" +else +local_cflags_property = +endif + compile: @install -d "${OUTPUT_PATH}" @echo "Building ${SKETCH_FILE_PATH}" @@ -132,8 +138,7 @@ compile: --build-path "${BUILD_PATH}" \ --output-dir "${OUTPUT_PATH}" \ --build-cache-path "${CORE_CACHE_PATH}" \ - --build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}" \ - --warnings all ${ccache_wrapper_property} \ + --warnings all ${ccache_wrapper_property} ${local_cflags_property} \ "${SKETCH_FILE_PATH}" ifeq ($(LIBONLY),) @cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}"