Add option to build LoRaMac sources as a static library#1368
Add option to build LoRaMac sources as a static library#1368dmeehan1968 wants to merge 31 commits intoLora-net:masterfrom
Conversation
|
Would be useful. |
|
Thanks for the proposition. |
|
There is an argument with this that its used to rework the examples (using the parallel directory structure to leave the legacty as-is) so that they are built using the static library targets. In time, this can then be worked back into the src tree. I don't see that as being a change of interface (respect your choice as to when to integrate of course). I can't really do the range of examples due to lack of hardware/toolchain. In fact I only have our custom boards which are only MCU/radio similar to the B-L027-LRWAN-1 example, but it's at least the same toolchain. I could do an example based off that if you're interested. Do you think that should be another PR, or add to this? |
c372cbb to
a7a07e8
Compare
|
Rebased onto current master, v4.7.0 (plus comment fix) |
|
Watching this closely. |
Intention of this PR is to allow developers to build the LoRaMac sources as a static library for inclusion in their own projects.
A separate directory is added to the project called
as-libwhich contains a set of CMakeLists.txt files that shadow the directory structure undersrc. A backwards compatible change is made to the project root CMakeLists.txt which, when provided with the option LORAMAC_AS_LIB, will direct CMake to reference theas-libdirectory instead ofsrc. The option default is OFF so that the past build behaviour is preserved as the default.A README.md is provided in the
as-libdirectory with an outline of options/settings that can be applied to the build. A standardLORAMAC_prefix is applied to all options to aid interoperatibility with other project sources.This is a rough draft and is currently working within my own project. I will add usage instructions to the README shortly.
I'm currently loading the repo into the project via CMake's FetchContent, as this allows the inclusion of the project root via
add_subdirectorywhilst specifying other options, such as building regional specific variants (my own projects tend to have different builds for each desired LoRaWAN region, rather than a single multi-region build (although this is also intended to be supported by this facility).Feedback, enhancements and criticism welcome.