There should be mechanism for library maintainers to ignore source files (for example unittest sources) to be included in the build that is created by mbed CLI/neo.
This issue probably belongs in https://github.com/ARMmbed/mbed-os since the build system lives there, but yes I think this is sensible
@SeppoTakalo This was discussed (and planned?) to extend make.py/build.py in @ARMmbed/mbed-os. Using make.py/build.py or through mbed CLI, you would be able to ignore source with `mbed compile [...] --ignore=mbed-os/net/...
@screamerbg I don't think that it would be acceptable solution.
_For example:_ I have library that contains platform specific source files. For mbed OS, i would need to exclude some of those files. The solution cannot be that I instruct the users of my library to add more command line options to their build commands.
It has to be that I as a library maintainer can specify list of files/folders to exclude from mbed OS build.
I propose syntax like .gitignore uses. There would be .neoignore or .mbedignore or similar.
The solution cannot be that I instruct the users of my library to add more command line options to their build commands.
Seconded. This feels really wrong. To me, it looks more and more that even when a program depends on mbed-os as a whole, it still needs to know its actual dependencies and only compile them, not everything in the tree.
I think both @SeppoTakalo and @bogdanm make valid points here. This also potentially gives us the added bonus of avoiding a "generation step" when releasing components like mbedtls and mbed-client to the mbed-os tree. If the main repos themselves can specify what is relevant source, then this "generation step" might be avoidable for a lot of existing components.
@SeppoTakalo wrote: "For example: I have library that contains platform specific source files. For mbed OS, i would need to exclude some of those files. The solution cannot be that I instruct the users of my library to add more command line options to their build commands."
Can you give an example what these platform specific source files are. Are they specific to K64F for example?
@sg-
@SeppoTakalo Good idea using .mbedignore as a mechanism for including paths and files when pulling in an external project that has a life of its own.
I believe @screamerbg is intending to fix this along the lines of the .mbed-ignore proposal, PR coming soon @screamerbg ?
The PR from @screamerbg is already merged so the simple method of ignoring folders exist. https://github.com/ARMmbed/mbed-os/pull/95
However, I did another PR to actually implement the functionality I proposed https://github.com/ARMmbed/mbed-os/pull/112
Please review it and comment. Thanks.
Now merged.
Most helpful comment
@screamerbg I don't think that it would be acceptable solution.
_For example:_ I have library that contains platform specific source files. For mbed OS, i would need to exclude some of those files. The solution cannot be that I instruct the users of my library to add more command line options to their build commands.
It has to be that I as a library maintainer can specify list of files/folders to exclude from mbed OS build.
I propose syntax like
.gitignoreuses. There would be.neoignoreor.mbedignoreor similar.