Library.json platform dependent build options

The documentation for introducing specific build options to a library.json file doesn’t seem to specify a way to make such options specific to a platform (f.e. esp32dev vs native). Is there a way for doing so?

https://docs.platformio.org/en/latest/manifests/library-json/index.html

https://docs.platformio.org/en/latest/manifests/library-json/fields/platforms.html

Thanks maxgerhardt, I’ve already been through those links, and all they tell me is that there is a way to specify multiple platforms in library.json and a build dictionary, without any examples or hints on how to restrict the build dictionary to a specific configuration (it seems to apply to all of them).

As it looks like the is no facility for that, I think I’l manually modify the build settings in the SCons environment via the extraScript, conditionalizing the set that’s used for the specific platform.

Ah, my bad. Yes to add specific compiler options for a platform you would need the library to have an extraScript (see links above). See

https://docs.platformio.org/en/latest/manifests/library-json/fields/build/extrascript.html