Skip to content

Commit 2a7b681

Browse files
committed
samples: Fix abuse of not including bootutil library
Fixes abuse of code where it wrongly assumed a library would just be available due to wrong code added to another repo that did always wrongly include a library when it should not have done Signed-off-by: Jamie McCrae <[email protected]>
1 parent e82b899 commit 2a7b681

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

samples/cellular/lwm2m_client/src/fota_external/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
zephyr_include_directories(include)
8-
9-
target_sources_ifdef(CONFIG_APP_SMP_CLIENT_FOTA_EXTERNAL
10-
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/client.c)
7+
if(CONFIG_APP_SMP_CLIENT_FOTA_EXTERNAL)
8+
zephyr_sources(${CMAKE_CURRENT_SOURCE_DIR}/client.c)
9+
zephyr_include_directories(include)
10+
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
11+
endif()

subsys/dfu/dfu_target/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ zephyr_library_sources_ifdef(CONFIG_DFU_TARGET_SMP
2727
src/dfu_target_smp.c
2828
)
2929
zephyr_library_sources(src/dfu_stream_flatten.c)
30-
if (CONFIG_DFU_TARGET_SUIT)
30+
31+
if(CONFIG_DFU_TARGET_SMP OR CONFIG_DFU_TARGET_MCUBOOT)
32+
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
33+
endif()
34+
35+
if(CONFIG_DFU_TARGET_SUIT)
3136
zephyr_library_sources(src/dfu_target_suit.c)
3237
zephyr_library_link_libraries(suit_memory_layout_interface)
3338
zephyr_library_link_libraries(suit_envelope_info)
3439
zephyr_library_link_libraries_ifdef(CONFIG_SUIT_CACHE_RW suit_cache_interface)
35-
if (CONFIG_SSF_SUIT_SERVICE_ENABLED)
40+
41+
if(CONFIG_SSF_SUIT_SERVICE_ENABLED)
3642
zephyr_library_link_libraries(suit_utils)
3743
endif()
3844
endif()

subsys/net/lib/fota_download/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ zephyr_include_directories_ifdef(CONFIG_SECURE_BOOT
3030
${ZEPHYR_NRF_MODULE_DIR}/subsys/dfu/include)
3131
zephyr_include_directories_ifdef(CONFIG_DOWNLOADER
3232
${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/downloader/include)
33+
34+
if(CONFIG_MCUBOOT_IMG_MANAGER)
35+
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
36+
endif()

subsys/net/lib/mcumgr_smp_client/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ zephyr_library_sources_ifdef(CONFIG_NRF_MCUMGR_SMP_CLIENT_SHELL
1212
src/mcumgr_smp_client_shell.c
1313
)
1414

15-
zephyr_include_directories(./include)
15+
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
16+
zephyr_include_directories(include)

0 commit comments

Comments
 (0)