Create Pre Compiled Headers

Is there any way to configure PlatformIO to build pre compile headers directly, or I should do it using the compiler itself and then add it to build flags?

Please check PlatformIO Advanced Scripting. You write own PRE script and generate what you need.