Skip to content

Commit

Permalink
More folders only compiled when their feature is Enabled (MarlinFirmw…
Browse files Browse the repository at this point in the history
…are#18780)

Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
rhapsodyv and thinkyhead committed Jul 26, 2020
1 parent 0bc8d31 commit e02817b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 25 deletions.
7 changes: 7 additions & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,3 +748,10 @@
#ifndef EXTRUDE_MINTEMP
#define EXTRUDE_MINTEMP 170
#endif

/**
* To check if we need the folder src/features/leds
*/
#if ANY(TEMP_STAT_LEDS, HAS_COLOR_LEDS, HAS_CASE_LIGHT, PRINTER_EVENT_LEDS, LED_BACKLIGHT_TIMEOUT, PCA9632_BUZZER, LED_CONTROL_MENU)
#define HAS_LED_FEATURE 1
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/**
* The purpose of this file is just include Marlin Configuration files,
* to discover which FEATURES are enabled, without any HAL include.
* Used by common-features-dependencies.py
* Used by common-dependencies.py
*/

#include <stdint.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# common-features-dependencies.py
# common-dependencies.py
# Convenience script to check dependencies and add libs and sources for Marlin Enabled Features
#
import subprocess
Expand Down Expand Up @@ -190,7 +190,7 @@ def load_marlin_features():
else:
cmd += ['-D' + s]

cmd += ['-w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-features-dependencies.h']
cmd += ['-w -dM -E -x c++ buildroot/share/PlatformIO/scripts/common-dependencies.h']
cmd = ' '.join(cmd)
print(cmd)
define_list = subprocess.check_output(cmd, shell=True).splitlines()
Expand Down
62 changes: 40 additions & 22 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ include_dir = Marlin
# The 'common' values are used for most Marlin builds
#
[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> -<src/lcd/extui/lib/mks_ui>
-<src/lcd/menu> -<src/lcd/dwin> -<src/lcd/extui/lib/dgus> -<src/lcd/extui/lib/ftdi_eve_touch_ui> -<src/lcd/dogm>
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/lcd/HD44780> -<src/lcd/dwin> -<src/lcd/dogm> -<src/lcd/menu>
-<src/lcd/extui/lib/mks_ui> -<src/lcd/extui/lib/dgus> -<src/lcd/extui/lib/ftdi_eve_touch_ui> -<src/lcd/extui/lib/anycubic>
-<src/sd/usb_flashdrive>
-<src/gcode/feature/trinamic>
-<src/feature/bedlevel/abl> -<src/gcode/bedlevel/abl>
-<src/feature/bedlevel/mbl> -<src/gcode/bedlevel/mbl>
-<src/feature/bedlevel/ubl> -<src/gcode/bedlevel/ubl>
-<src/feature/dac> -<src/feature/digipot>
-<src/feature/leds>
extra_scripts =
pre:buildroot/share/PlatformIO/scripts/common-features-dependencies.py
pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
Expand All @@ -37,24 +45,34 @@ lib_deps =
# Feature Dependencies
#
[features]
HAS_TFT_LVGL_UI = lvgl=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip
src_filter=+<src/lcd/extui/lib/mks_ui>
extra_scripts=download_mks_assets.py
HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1
SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
DIGIPOT_MCP4... = SlowSoftI2CMaster
HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
HAS_L64XX = [email protected]
NEOPIXEL_LED = Adafruit [email protected]
MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0
HAS_GRAPHICAL_LCD = [email protected]
src_filter=+<src/lcd/dogm>
USES_LIQUIDCRYSTAL = [email protected]
USES_LIQUIDTWI2 = [email protected]
TOUCH_UI_FTDI_EVE = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
HAS_DGUS_LCD = src_filter=+<src/lcd/extui/lib/dgus>
DWIN_CREALITY_LCD = src_filter=+<src/lcd/dwin>
HAS_LCD_MENU = src_filter=+<src/lcd/menu>
HAS_TFT_LVGL_UI = lvgl=https://github.com/makerbase-mks/MKS-LittlevGL/archive/master.zip
src_filter=+<src/lcd/extui/lib/mks_ui>
extra_scripts=download_mks_assets.py
HAS_TRINAMIC_CONFIG = TMCStepper@~0.7.1
src_filter=+<src/gcode/feature/trinamic>
SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
DIGIPOT_MCP4... = SlowSoftI2CMaster
HAS_TMC26X = TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
HAS_L64XX = [email protected]
NEOPIXEL_LED = Adafruit [email protected]
MAX6675_IS_MAX31865 = Adafruit MAX31865 library@~1.1.0
HAS_GRAPHICAL_LCD = [email protected]
src_filter=+<src/lcd/dogm>
USES_LIQUIDCRYSTAL = [email protected]
USES_LIQUIDTWI2 = [email protected]
DWIN_CREALITY_LCD = src_filter=+<src/lcd/dwin>
HAS_CHARACTER_LCD = src_filter=+<src/lcd/HD44780>
HAS_LCD_MENU = src_filter=+<src/lcd/menu>
HAS_DGUS_LCD = src_filter=+<src/lcd/extui/lib/dgus>
TOUCH_UI_FTDI_EVE = src_filter=+<src/lcd/extui/lib/ftdi_eve_touch_ui>
ANYCUBIC_TFT_MODEL = src_filter=+<src/lcd/extui/lib/anycubic>
USB_FLASH_DRIVE_SUPPORT = src_filter=+<src/sd/usb_flashdrive>
AUTO_BED_LEVELING_(3POINT|(BI)?LINEAR) = src_filter=+<src/feature/bedlevel/abl> +<src/gcode/bedlevel/abl>
MESH_BED_LEVELING = src_filter=+<src/feature/bedlevel/mbl> +<src/gcode/bedlevel/mbl>
AUTO_BED_LEVELING_UBL = src_filter=+<src/feature/bedlevel/ubl> +<src/gcode/bedlevel/ubl>
DAC_STEPPER_CURRENT = src_filter=+<src/feature/dac>
HAS_I2C_DIGIPOT = src_filter=+<src/feature/digipot>
HAS_LED_FEATURE = src_filter=+<src/feature/leds>
(ESP3D_)?WIFISUPPORT = AsyncTCP, ESP Async WebServer
ESP3DLib=https://github.com/luc-github/ESP3DLib.git
arduinoWebSockets=https://github.com/Links2004/arduinoWebSockets.git
Expand Down Expand Up @@ -699,7 +717,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
platform = ${common_stm32f1.platform}
extends = common_stm32f1
board = CHITU_F103
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-features-dependencies.py
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
buildroot/share/PlatformIO/scripts/chitu_crypt.py
build_flags = ${common_stm32f1.build_flags}
Expand Down

0 comments on commit e02817b

Please sign in to comment.