PlatformIO Community

PIO takes sooooo long to build my marlin 2.0.x project

After a long and exhaustive search on the forums and googling around, i still dont understand why pio builds and compiles the whole marlin folder even when a single fullstop has been changed in any of the underlying files. It takes varying times from 5min - 20min which is soo painful coz i cant get any work done. soo frustrating so therefore am asking for your help.

This is the folder structure of my marlin folder in vscode.

kinky

Am compiling for an LPC1768 platform.

Below is what constitutes my platformio.ini file.

[platformio]
src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = LPC1768

[common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
lib_deps =
  LiquidCrystal
  TMCStepper@>=0.6.2,<1.0.0
  Adafruit NeoPixel
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip
  LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip
  Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/0.8.0.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
  SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip
  SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip

# Globally defined properties -  inherited by all environments
[env]
framework     = arduino
build_flags   = ${common.build_flags}
lib_deps      = ${common.lib_deps}
monitor_speed = 250000

[env:LPC1768]
platform          = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.2.zip
board             = nxp_lpc1768
build_flags       = -DU8G_HAL_LINKS -IMarlin/src/HAL/LPC1768/include -    IMarlin/src/HAL/LPC1768/u8g ${common.build_flags}
# debug options for backtrace
#  -funwind-tables
#  -mpoke-function-name
lib_ldf_mode      = off
lib_compat_mode   = strict
extra_scripts     = Marlin/src/HAL/LPC1768/upload_extra_script.py
src_filter        = ${common.default_src_filter} +<src/HAL/LPC1768>
upload_port       = G:
lib_deps          = Servo
  LiquidCrystal
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  TMCStepper@>=0.6.1,<1.0.0
  Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/release.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip

Am using PlatformIO Core 4.4.0a3, Home 3.2.3 and vscode 1.46.1