I want to compile my source file to a static library by platform, so my all projects can use it easier.
PlatformIO does this automatically, see .a files here Redirecting...
.a