How use a same chip but with different environment?

I follow the examples step by step, and succeed! Thank you again!
After I customize my board use the Chip stm32L476RG and has none business with the eval board(The offical nucleo board), Here is the problem, I should use the variant_generic.cpp/h instead of the variant_NUCLEO_L476RG.cpp/h, like the picture show, you can also see my platformio.ini but I do not know how to use it?


So I try to slove this problem, I find the [/.platformio/packages/framework-arduinoststm32/cores/arduino/variant.h] the macros VARIANT_H = “variant_NUCLEO_L476RG.h”,
but I still do not know how it happened?