From f34024af3457d1d5e2f6b4d7fe83f5b00f8fb597 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Tue, 21 Jul 2020 05:15:20 -0300 Subject: [PATCH] Filter some unused Marlin/src subfolders (#18729) --- .../scripts/common-features-dependencies.py | 21 ++++++++----------- platformio.ini | 6 ++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py index a04f2e0ee..72abfdd67 100644 --- a/buildroot/share/PlatformIO/scripts/common-features-dependencies.py +++ b/buildroot/share/PlatformIO/scripts/common-features-dependencies.py @@ -96,12 +96,10 @@ def install_features_dependencies(): del deps_to_add[name] # any left? - if len(deps_to_add) <= 0: - continue - - # add only the missing deps - proj = env.GetProjectConfig() - proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values())) + if len(deps_to_add) > 0: + # add only the missing deps + proj = env.GetProjectConfig() + proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values())) if 'extra_scripts' in FEATURE_DEPENDENCIES[feature]: print("Executing extra_scripts for %s... " % feature) @@ -110,17 +108,16 @@ def install_features_dependencies(): if 'src_filter' in FEATURE_DEPENDENCIES[feature]: print("Adding src_filter for %s... " % feature) proj = env.GetProjectConfig() - src_filter = env.GetProjectOption("src_filter") - + src_filter = ' '.join(env.GetProjectOption("src_filter")) # first we need to remove the references to the same folder my_srcs = re.findall( r'[+-](<.*?>)', FEATURE_DEPENDENCIES[feature]['src_filter']) - cur_srcs = re.findall( r'[+-](<.*?>)', src_filter[0]) + cur_srcs = re.findall( r'[+-](<.*?>)', src_filter) for d in my_srcs: if d in cur_srcs: - src_filter[0] = re.sub(r'[+-]' + d, '', src_filter[0]) + src_filter = re.sub(r'[+-]' + d, '', src_filter) - src_filter[0] = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter[0] - proj.set("env:" + env["PIOENV"], "src_filter", src_filter) + src_filter = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter + proj.set("env:" + env["PIOENV"], "src_filter", [src_filter]) env.Replace(SRC_FILTER=src_filter) # search the current compiler, considering the OS diff --git a/platformio.ini b/platformio.ini index 0bc559b09..865755d73 100644 --- a/platformio.ini +++ b/platformio.ini @@ -26,6 +26,7 @@ include_dir = Marlin # [common] default_src_filter = + - - + - + - - - - - extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-features-dependencies.py pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -48,7 +49,12 @@ HAS_L64XX = Arduino-L6470@0.8.0 NEOPIXEL_LED = Adafruit NeoPixel@1.5.0 MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0 HAS_GRAPHICAL_LCD = U8glib-HAL@0.4.1 + src_filter=+ HAS_CHARACTER_LCD = LiquidCrystal@1.5.0, LiquidTWI2@1.2.7 +TOUCH_UI_FTDI_EVE = src_filter=+ +HAS_DGUS_LCD = src_filter=+ +DWIN_CREALITY_LCD = src_filter=+ +HAS_LCD_MENU = src_filter=+ # # Default values apply to all 'env:' prefixed environments