How to avoid recompilation of Relase and Debug ESP32 versions?

I am developing an esp-idf project. Sometimes I run the program and sometimes I debug the program. Each time that I switch mode, platformio recompiles the respective version from scratch which is very lengthy.

Is there a way to have two cached build version such that each time platformio does does an incremental build?

My platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf
monitor_speed = 115200
debug_tool=esp-prog
upload_port=COM6