Skip to content

Commit

Permalink
openthread: allow to build from Thread 1.2 libraries
Browse files Browse the repository at this point in the history
Add `OPENTHREAD_LIBRARY` to make it a more general configuration
option allowing to select the proper Thread library based on the
`OPENTHREAD_THREAD_VERSION` configuration.

Signed-off-by: Eduardo Montoya <[email protected]>
  • Loading branch information
edmont authored and rlubos committed Jan 28, 2022
1 parent 3b22148 commit dfeb304
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions openthread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ if(CONFIG_OPENTHREAD_SOURCES)
add_custom_target(install_openthread_libraries ${INSTALL_COMMANDS})
endif()

if (CONFIG_OPENTHREAD_LIBRARY_1_1)
openthread_calculate_lib_path("v1.1" OT_LIB_PATH)
if (CONFIG_OPENTHREAD_NORDIC_LIBRARY)
openthread_calculate_lib_path("v${CONFIG_OPENTHREAD_THREAD_VERSION}" OT_LIB_PATH)

if(NOT EXISTS ${OT_LIB_PATH})
message(FATAL_ERROR
Expand Down
12 changes: 10 additions & 2 deletions openthread/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ choice OPENTHREAD_IMPLEMENTATION
Select OpenThread to use for build. Custom OpenThread implementations
can be added to the application Kconfig.

config OPENTHREAD_LIBRARY
bool "OpenThread from library"
select OPENTHREAD_NORDIC_LIBRARY
help
Build OpenThread from a prebuilt library instead of building from sources.
CONFIG_OPENTHREAD_THREAD_VERSION determines which version of the library is to be used.

config OPENTHREAD_LIBRARY_1_1
bool "OpenThread 1.1 from library"
bool "(Legacy) OpenThread 1.1 from library"
depends on OPENTHREAD_THREAD_VERSION_1_1
select OPENTHREAD_NORDIC_LIBRARY
help
Uses prebuilt library of openthread instead of building from sources.
Legacy option to use prebuilt OpenThread 1.1 library.

endchoice

Expand Down

0 comments on commit dfeb304

Please sign in to comment.