From e54a0b19f71b2dcc4108d2079c0cf1c3a691bb68 Mon Sep 17 00:00:00 2001 From: Emanuele Di Santo Date: Wed, 11 Oct 2023 14:07:48 +0200 Subject: [PATCH] nrf_modem: update build system files Introduce a Kconfig choice for the binary version. Signed-off-by: Emanuele Di Santo --- nrf_modem/CMakeLists.txt | 10 ++++++---- nrf_modem/Kconfig | 21 +++++++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/nrf_modem/CMakeLists.txt b/nrf_modem/CMakeLists.txt index 819d676017..a6e011f99d 100644 --- a/nrf_modem/CMakeLists.txt +++ b/nrf_modem/CMakeLists.txt @@ -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) diff --git a/nrf_modem/Kconfig b/nrf_modem/Kconfig index ce19b9831a..5a27f11bda 100644 --- a/nrf_modem/Kconfig +++ b/nrf_modem/Kconfig @@ -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 @@ -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