Hello,
i have made the change shown here Tidy up conditional targets. by prenticedavid · Pull Request #1 · lcdwiki/LCDWIKI_SPI · GitHub
using softwareSPI mylcd(ST7796S, 5, 13, 19, 23, 12, 18, -1); //ESP32
ST7796S 4.0inch TFT SPI is working fine with esp32 need to try touch function now
Thanks a lot david for your work !