I don't think that we should add #ifdef to the code. We can use the same Kconfig exclusion as on the other components
Best regards Alin On Sat, 18 Mar 2023, 09:00 raiden00pl, <raiden0...@gmail.com> wrote: > Wrapping the entire file with '#ifdef' makes debugging complex preprocessor > logic a nightmare, so I'm not a fan of this idea. > Looking for the missing `#endif` in such a file can be really frustrating. > > pt., 17 mar 2023 o 16:42 Nathan Hartman <hartman.nat...@gmail.com> > napisał(a): > > > On Wed, Mar 15, 2023 at 6:16 AM raiden00pl <raiden0...@gmail.com> wrote: > > > > > > NVMC support for NRF52 chips was ported from Nordic SDK which was > > released > > > on the BSD license (old times), so these features should depend on > > > CONFIG_ALLOW_BSD_COMPONENTS=y. Users must manually enable support for > the > > > BSD components to continue using the mentioned features. > > > > > > Related PR: https://github.com/apache/nuttx/pull/8827 > > > > > > Thanks for posting about it to the list. I just added my review there, > > but it got me thinking: > > > > We have many files listed in LICENSE which are non-Apache-2.0-License > > and I haven't had a chance to check but I have a feeling that there > > could be more files that should be protected by ALLOW_BSD_COMPONENTS / > > ALLOW_MIT_COMPONENTS / ALLOW_GPL_COMPONENTS / ALLOW_*_COMPONENTS that > > are not currently protected. > > > > For each file that has a non-Apache-2.0-License at the top, should we > > wrap the entire file contents with: > > > > #ifdef ALLOW_*_COMPONENTS > > . > > . > > . > > #endif /* ALLOW_*_COMPONENTS */ > > > > (for the appropriate value of * of course)? > > > > Yes, doing that will cause compiler errors when a build tries to use > > those files and doesn't have the required ALLOW_*_COMPONENTS enabled, > > but that will help us find all those cases relatively quickly and fix > > them by adding "depends on ALLOW_*_COMPONENTS" in Kconfig. > > > > It will ensure that when someone doesn't choose ALLOW_BSD_COMPONENTS / > > ALLOW_MIT_COMPONENTS / ALLOW_GPL_COMPONENTS then their build will > > actually be licensed as advertised. > > > > If we want to do it then obviously it should be separate PRs, maybe > > one for each component we find... > > > > Thoughts? > > > > Nathan > > >