Browse Source

Filter some unused Marlin/src subfolders (#18729)

Victor Oliveira 3 years ago
parent
commit
f34024af34
No account linked to committer's email address
2 changed files with 15 additions and 12 deletions
  1. 9
    12
      buildroot/share/PlatformIO/scripts/common-features-dependencies.py
  2. 6
    0
      platformio.ini

+ 9
- 12
buildroot/share/PlatformIO/scripts/common-features-dependencies.py View File

@@ -96,12 +96,10 @@ def install_features_dependencies():
96 96
 					del deps_to_add[name]
97 97
 
98 98
 			# any left?
99
-			if len(deps_to_add) <= 0:
100
-				continue
101
-
102
-			# add only the missing deps
103
-			proj = env.GetProjectConfig()
104
-			proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values()))
99
+			if len(deps_to_add) > 0:
100
+				# add only the missing deps
101
+				proj = env.GetProjectConfig()
102
+				proj.set("env:" + env["PIOENV"], "lib_deps", deps + list(deps_to_add.values()))
105 103
 
106 104
 		if 'extra_scripts' in FEATURE_DEPENDENCIES[feature]:
107 105
 			print("Executing extra_scripts for %s... " % feature)
@@ -110,17 +108,16 @@ def install_features_dependencies():
110 108
 		if 'src_filter' in FEATURE_DEPENDENCIES[feature]:
111 109
 			print("Adding src_filter for %s... " % feature)
112 110
 			proj = env.GetProjectConfig()
113
-			src_filter = env.GetProjectOption("src_filter")
114
-
111
+			src_filter = ' '.join(env.GetProjectOption("src_filter"))
115 112
 			# first we need to remove the references to the same folder
116 113
 			my_srcs = re.findall( r'[+-](<.*?>)', FEATURE_DEPENDENCIES[feature]['src_filter'])
117
-			cur_srcs = re.findall( r'[+-](<.*?>)', src_filter[0])
114
+			cur_srcs = re.findall( r'[+-](<.*?>)', src_filter)
118 115
 			for d in my_srcs:
119 116
 				if d in cur_srcs:
120
-					src_filter[0] = re.sub(r'[+-]' + d, '', src_filter[0])
117
+					src_filter = re.sub(r'[+-]' + d, '', src_filter)
121 118
 
122
-			src_filter[0] = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter[0]
123
-			proj.set("env:" + env["PIOENV"], "src_filter", src_filter)
119
+			src_filter = FEATURE_DEPENDENCIES[feature]['src_filter'] + ' ' + src_filter
120
+			proj.set("env:" + env["PIOENV"], "src_filter", [src_filter])
124 121
 			env.Replace(SRC_FILTER=src_filter)
125 122
 
126 123
 # search the current compiler, considering the OS

+ 6
- 0
platformio.ini View File

@@ -26,6 +26,7 @@ include_dir  = Marlin
26 26
 #
27 27
 [common]
28 28
 default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> -<src/lcd/extui/lib/mks_ui>
29
+  -<src/lcd/menu> -<src/lcd/dwin> -<src/lcd/extui/lib/dgus> -<src/lcd/extui/lib/ftdi_eve_touch_ui> -<src/lcd/dogm>
29 30
 extra_scripts      =
30 31
   pre:buildroot/share/PlatformIO/scripts/common-features-dependencies.py
31 32
   pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
@@ -48,7 +49,12 @@ HAS_L64XX           = Arduino-L6470@0.8.0
48 49
 NEOPIXEL_LED        = Adafruit NeoPixel@1.5.0
49 50
 MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0
50 51
 HAS_GRAPHICAL_LCD   = U8glib-HAL@0.4.1
52
+                      src_filter=+<src/lcd/dogm>
51 53
 HAS_CHARACTER_LCD   = LiquidCrystal@1.5.0, LiquidTWI2@1.2.7
54
+TOUCH_UI_FTDI_EVE   = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
55
+HAS_DGUS_LCD        = src_filter=+<src/lcd/extui/lib/dgus>
56
+DWIN_CREALITY_LCD   = src_filter=+<src/lcd/dwin>
57
+HAS_LCD_MENU        = src_filter=+<src/lcd/menu>
52 58
 
53 59
 #
54 60
 # Default values apply to all 'env:' prefixed environments

Loading…
Cancel
Save