-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to build LoRaMac sources as a static library #1368
base: master
Are you sure you want to change the base?
Add option to build LoRaMac sources as a static library #1368
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-lib
which 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-lib
directory 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-lib
directory 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_subdirectory
whilst 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.