Extract `NativeSourcePlugin`
This PR branches off of https://github.com/scala-native/scala-native/pull/2566 to try extracting out a plugin for native sources as suggested in https://github.com/scala-native/scala-native/pull/2566#issuecomment-1046936972.
I wonder if in the final implementation we can merge some ideas from https://github.com/scala-native/scala-native/pull/2325 eg. filtering sources.
@ekrich do you know what the connection of this PR is to https://github.com/scala-native/scala-native/pull/2325? It wasn't obvious to me.
I haven't had enough time yet to look at this PR. I don't think they are super related. Some of the parts of the build plugin concept had to do with filtering for windows that is now done in a different way and also conditional linking solved some of the things that were needed. I will put a comment on #2325 as an update.