libremidi icon indicating copy to clipboard operation
libremidi copied to clipboard

[cmake] Fix warnings showing up when client uses stronger warnings than library

Open lilggamegenius opened this issue 1 year ago • 0 comments

After a lot of digging, I finally managed to decipher cmake's docs and figure out how to fix the issue of warnings leaking into other projects. The previous PR already stops warning settings from leaking into client projects, and this one fixes up the reverse so the user's warnings won't trigger when including this projects headers.

The fix was to duplicate the include directories. The first are the ones that get set when the client project links against this library so we mark it as SYSTEM so warnings are suppressed. The second are set privately and not marked as SYSTEM, so warnings still appear when compiling the library normally.

With both the previous PR and this one, you should be able to safely set whatever warning settings you wish.

lilggamegenius avatar Jan 25 '24 05:01 lilggamegenius