avr/io.h no such file or directory with the library of jm_wire

It can easily be accomplished:

#ifndef __AVR__
#error This library only supports the AVR architecture
#endif
#include <avr/io.h>

But what happens if you are compiling for a non-AVR architecture that has added an avr/io.h file for compatibility with code written for AVR? Now compilation fails unnecessarily. One example of this is Arduino SAMD Boards, which does have avr/io.h even though it's not AVR architecture. And you can't use #warning because the warning will never be shown if a file not found error is encountered. I could add a SAMD boards specific macro to the conditional but I have no way of knowing all the possible packages now or in the future that have to be "whitelisted" from this error.

There actually is a feature of the Arduino IDE that displays a warning when compiling for an architecture that is not specified by the library's library.properties file but unfortunately that warning is not displayed after a file not found error. I have reported this issue here:

Hopefully it will be fixed soon.