Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Fix connectivity version in DFU (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenr authored Dec 19, 2018
1 parent c6c23be commit 08b10bb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,17 @@ function(nrf_create_connectivity_compile_targets)

message(STATUS "Running make:${MAKE} in ARMGCC_PROJECT_DIRECTORY:${ARMGCC_PROJECT_DIRECTORY}")

# Add CFLAGS that specify application version, used by SDFU
set(MAJOR)
set(MINOR)
set(PATCH)
nrf_extract_version_number("${CONNECTIVITY_VERSION}" MAJOR MINOR PATCH)
set(VERSION_CFLAGS "-DAPP_VERSION_MAJOR=${MAJOR} -DAPP_VERSION_MINOR=${MINOR} -DAPP_VERSION_PATCH=${PATCH}")

# Compile project
add_custom_command(
OUTPUT "${COMMAND_NAME}"
APPEND COMMAND ${MAKE}
APPEND COMMAND ${CMAKE_COMMAND} -E env CFLAGS=${VERSION_CFLAGS} ${MAKE}
)

set(HEX_MERGED "${TARGET_NAME}.hex")
Expand Down Expand Up @@ -272,7 +279,7 @@ function(nrf_create_connectivity_compile_targets)
# Copy connectivity hex file to binary make_directory
add_custom_command(
OUTPUT "${COMMAND_NAME}"
APPEND COMMAND ${CMAKE_COMMAND} -E copy "${APP_HEX_PATH}" "${OUTPUT_DIRECTORY}/${CONNECTIVITY_NAME}.hex"
APPEND COMMAND ${CMAKE_COMMAND} -E copy "${APP_HEX_PATH}" "${OUTPUT_DIRECTORY}/${CONNECTIVITY_NAME}_for_${SD_VERSION}_${SD_API_VERSION}.hex"
)
endif()
endif()
Expand Down

0 comments on commit 08b10bb

Please sign in to comment.