From 3f4f2dcedb06ce05f27604df1e4c238537252b2f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 2 Mar 2022 15:04:48 -0800 Subject: [PATCH] Add a new KALEIDOSCOPE_LOCAL_LIB_DIR env variable that you can use to set up a custom directory containing Arduino libraries to include in your sketch's library search path. Signed-off-by: Jesse Vincent --- etc/makefiles/sketch.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index 987f9c6c..a5c5ceb5 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -167,9 +167,20 @@ else local_cflags_property = endif -compile: +# If you set KALEIDOSCOPE_LOCAL_LIB_DIR to the name of a directory, +# all of the Arduino libraries inside that directory should be used +# in preference to any library with the same name further dow the search path + +ifneq ($(KALEIDOSCOPE_LOCAL_LIB_DIR),) +_arduino_local_libraries_prop = --libraries "${KALEIDOSCOPE_LOCAL_LIB_DIR}" +endif + +compile: + + $(QUIET) install -d "${OUTPUT_PATH}" $(QUIET) $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} --warnings all ${ccache_wrapper_property} ${local_cflags_property} \ + ${_arduino_local_libraries_prop} \ --library "${KALEIDOSCOPE_DIR}" \ --libraries "${KALEIDOSCOPE_DIR}/plugins/" \ --build-path "${BUILD_PATH}" \