@@ -104,38 +104,41 @@ else()
104104 gen_wolfboot_platform_target(${PLATFORM_NAME} bootloader_linker_script)
105105endif ()
106106
107- add_executable (image)
107+ if (BUILD_TEST_APPS)
108+ message (STATUS "Building wolfBoot test apps" )
109+ add_executable (image)
108110
109- target_sources (image PRIVATE ${APP_SOURCES} )
111+ target_sources (image PRIVATE ${APP_SOURCES} )
110112
111- target_include_directories (image PRIVATE
112- ../
113- ../include
114- ${CMAKE_CURRENT_BINARY_DIR} )
113+ target_include_directories (image PRIVATE
114+ ../
115+ ../include
116+ ${CMAKE_CURRENT_BINARY_DIR} )
115117
116- target_link_libraries (image wolfboot target )
118+ target_link_libraries (image wolfboot target )
117119
118- target_compile_definitions (image PRIVATE PLATFORM_${WOLFBOOT_TARGET}
119- ${TEST_APP_COMPILE_DEFINITIONS} ${WOLFBOOT_DEFS} )
120+ target_compile_definitions (image PRIVATE PLATFORM_${WOLFBOOT_TARGET}
121+ ${TEST_APP_COMPILE_DEFINITIONS} ${WOLFBOOT_DEFS} )
120122
121- target_compile_options (image PRIVATE -Wall -Wstack-usage=1024 -ffreestanding -Wno-unused
122- -nostartfiles)
123+ target_compile_options (image PRIVATE -Wall -Wstack-usage=1024 -ffreestanding -Wno-unused
124+ -nostartfiles)
123125
124- if (WOLFBOOT_TARGET STREQUAL "sim" )
125- target_link_options (image PRIVATE -Wl,-gc-sections -Wl,-Map=image.map)
126- else ()
127- target_link_options (image PRIVATE -T${APP_LSCRIPT} -Wl,-gc-sections -Wl,-Map=image.map)
128- endif ()
126+ if (WOLFBOOT_TARGET STREQUAL "sim" )
127+ target_link_options (image PRIVATE -Wl,-gc-sections -Wl,-Map=image.map)
128+ else ()
129+ target_link_options (image PRIVATE -T${APP_LSCRIPT} -Wl,-gc-sections -Wl,-Map=image.map)
130+ endif ()
129131
130- if (WOLFBOOT_TARGET IN_LIST ARM_TARGETS)
131- message (STATUS "Binary output products will be generated" )
132- gen_bin_target_outputs(image)
132+ if (WOLFBOOT_TARGET IN_LIST ARM_TARGETS)
133+ message (STATUS "Binary output products will be generated" )
134+ gen_bin_target_outputs(image)
133135
134- # add boot address to cache
135- unset (${PLATFORM_NAME} _BOOT_ADDRESS CACHE )
136- set (${PLATFORM_NAME} _BOOT_ADDRESS ${WOLFBOOT_PARTITION_BOOT_ADDRESS} CACHE INTERNAL "" )
136+ # add boot address to cache
137+ unset (${PLATFORM_NAME} _BOOT_ADDRESS CACHE )
138+ set (${PLATFORM_NAME} _BOOT_ADDRESS ${WOLFBOOT_PARTITION_BOOT_ADDRESS} CACHE INTERNAL "" )
137139
138- gen_wolfboot_factory_image(${PLATFORM_NAME} image)
139- else ()
140- gen_wolfboot_signed_image(image)
140+ gen_wolfboot_factory_image(${PLATFORM_NAME} image)
141+ else ()
142+ gen_wolfboot_signed_image(image)
143+ endif ()
141144endif ()
0 commit comments