Skip to content

Commit

Permalink
samples: net: download: Fix compilation with secure socket disabled
Browse files Browse the repository at this point in the history
Fix compilation error when secure socket has been disabled in the
sample.
Because of Kconfig dependency the sample cert file is not defined
resulting in cmake error.

Signed-off-by: Joakim Andersson <[email protected]>
  • Loading branch information
joerchan authored and nordicjm committed Jan 15, 2025
1 parent 8ea3f6f commit 2a8403e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions samples/net/download/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(download)

# Generate hex file from pem file
get_filename_component(FILE_NAME ${CONFIG_SAMPLE_CERT_FILE} NAME)
set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/certs/${FILE_NAME}.inc")
add_definitions(-DSAMPLE_CERT_FILE_INC="${OUTPUT_FILE}")
generate_inc_file_for_target(
if(CONFIG_SAMPLE_SECURE_SOCKET)
get_filename_component(FILE_NAME ${CONFIG_SAMPLE_CERT_FILE} NAME)
set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/certs/${FILE_NAME}.inc")
add_definitions(-DSAMPLE_CERT_FILE_INC="${OUTPUT_FILE}")
generate_inc_file_for_target(
app
${CONFIG_SAMPLE_CERT_FILE}
${OUTPUT_FILE}
)
)
endif()

# NORDIC SDK APP START
target_sources(app PRIVATE src/main.c)
Expand Down

0 comments on commit 2a8403e

Please sign in to comment.