Skip to content

Commit

Permalink
nrf_modem: update build system files
Browse files Browse the repository at this point in the history
Introduce a Kconfig choice for the binary version.

Signed-off-by: Emanuele Di Santo <[email protected]>
  • Loading branch information
lemrey committed Oct 13, 2023
1 parent 9b376e1 commit e54a0b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
10 changes: 6 additions & 4 deletions nrf_modem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ if(CONFIG_NRF_MODEM_LINK_BINARY)
set(float_dir soft-float)
endif()

set(NRF_MODEM_LIB_DIR "lib/${arch_soc_dir}/${float_dir}")
set(NRF_MODEM_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/${arch_soc_dir}/${float_dir}")

if(CONFIG_NRF_MODEM_LOG)
zephyr_library_import(modem ${CMAKE_CURRENT_SOURCE_DIR}/${NRF_MODEM_LIB_DIR}/libmodem_log.a)
if(CONFIG_NRF_MODEM_DEFAULT)
zephyr_library_import(modem ${NRF_MODEM_LIB_DIR}/libmodem.a)
elseif(CONFIG_NRF_MODEM_LOG)
zephyr_library_import(modem ${NRF_MODEM_LIB_DIR}/libmodem_log.a)
else()
zephyr_library_import(modem ${CMAKE_CURRENT_SOURCE_DIR}/${NRF_MODEM_LIB_DIR}/libmodem.a)
assert(0 "Unreachable code")
endif()

zephyr_include_directories(include)
Expand Down
21 changes: 17 additions & 4 deletions nrf_modem/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ config NRF_MODEM
bool
imply FPU_SHARING

config NRF_MODEM_LINKABLE
bool

menu "nrf_modem (Modem library)"
visible if NRF_MODEM

Expand All @@ -12,14 +15,24 @@ choice NRF_MODEM_BUILD_STRATEGY

config NRF_MODEM_LINK_BINARY
bool "Link binary"
select NRF_MODEM_LINKABLE
endchoice

choice NRF_MODEM_BINARY_CHOICE
prompt "Choose binary"
depends on NRF_MODEM_LINKABLE
default NRF_MODEM_BINARY_DEFAULT

config NRF_MODEM_DEFAULT
bool "default"
help
Link with the default binary.

config NRF_MODEM_LOG
depends on NRF_MODEM_LINK_BINARY
bool "Use version of the library with logs"
bool "with logs"
help
Links the application with the library version capable of emitting logs.
This increases the final size of the application.
Link with the binary capable of emitting logs.
endchoice

endmenu

Expand Down

0 comments on commit e54a0b1

Please sign in to comment.