Detect development platform OS

I use VSCode/Platformio on both a Windows PC and a linux box. My project files and libraries are stored on a share on my NAS drive accessible to both systems. On the PC the share is mapped as the P: drive and under linux as $HOME/projects. As a result, I need two versions of each environment in platform.ini to cater for each system. It would be
nice if I could write something like;

if defined WINDOWS
        LIBDIR = "P:/libraries"

else if defined LINUX
        LIBDIR = $HOME/projects/libraries
[env:ESP32]
platform = espressif32
board = esp32dev
lib_deps = 
    $LIBDIR/LiquidCrystal_I2C  

Is there a way of doing this? (A similar question was asked back in 2019 but something may have changed since then)