Extra_script for a special library

I got some config in config.h which located $PROJECT_INCLUDE_DIR, and I need add it to a library(let’s say testLib).

At first, I add an test.py to testLib.

It works fine when I try to use config in .c file. while got error when I use that in .h file.

So I add “-include $PROJECT_INCLUDE_DIR/config.h” to platformio.ini’s build_flags, but it seemed that compiler add to all files include idf framework files…
I think it should be work if I make some script to platformio.ini., only add “-include $PROJECT_INCLUDE_DIR/config.h” to the testLib. but I doesn’t got the way…