Skip to content

Commit

Permalink
fix: use IC_FW_VERSION in IC_FULL_NAME; add git hash to IC_FULL_NAME;…
Browse files Browse the repository at this point in the history
… remove project() call
  • Loading branch information
JPHutchins committed Dec 4, 2023
1 parent 24acf97 commit 9bfbc5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/ic_project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ function(ic_project
endforeach()

set_definition("${out_client_name}" ${_CLIENT_NAME} PARENT_SCOPE)

project(${_PROJECT_NAME})
if(NOT ${_PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
message(FATAL_ERROR "${_PROJECT_NAME} != ${CMAKE_PROJECT_NAME}")
endif()
set_definition("${out_project_name}" ${CMAKE_PROJECT_NAME} PARENT_SCOPE)

set_definition("${out_project_name}" ${_PROJECT_NAME} PARENT_SCOPE)
set_definition("${out_board_name}" "${_BOARD_NAME}" PARENT_SCOPE)
if_set_definition("${out_board_rev}" "${_BOARD_REV}" PARENT_SCOPE)
if_set_definition("${out_fw_version}" "${_FW_VERSION}" PARENT_SCOPE)
Expand Down Expand Up @@ -203,7 +197,7 @@ function(ic_project
# Set the config string for use in naming files, docs, etc.
set(
config_string
${_CLIENT_NAME}_${CMAKE_PROJECT_NAME}_${_BOARD_NAME}${board_rev_string}_${git_tag}_${build_date}${build_type_string}
"${_CLIENT_NAME}_${_PROJECT_NAME}_${_BOARD_NAME}${board_rev_string}_${${out_fw_version}}_${git_hash}_${build_date}${build_type_string}"
)
string(REPLACE " " "_" config_string ${config_string})
set_definition("${out_full_name}" ${config_string} PARENT_SCOPE)
Expand Down
13 changes: 11 additions & 2 deletions tests/test_ic_project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endforeach()
assert(Flumbr STREQUAL ${IC_CLIENT_NAME})
assert("Dipple Snurp 3" STREQUAL ${IC_PROJECT_NAME})
assert(FF3 STREQUAL ${IC_BOARD_NAME})
assert(${IC_FULL_NAME} MATCHES Flumbr_Dipple_Snurp_3_FF3_.+_[0-9]+)
assert(${IC_FULL_NAME} MATCHES "Flumbr_Dipple_Snurp_3_FF3_.+\\+?_[0-9a-fA-F]+\\+?_[0-9]+")

foreach(ic_out_var ${ic_out})
unset("${ic_out_var}")
Expand Down Expand Up @@ -70,7 +70,11 @@ assert(toffee STREQUAL ${IC_BOARD_NAME})
assert(NFF2 STREQUAL ${IC_BOARD_REV})
assert(proto STREQUAL ${IC_BUILD_TYPE})
assert(Flampr STREQUAL ${IC_CLIENT_NAME})
assert(${IC_FULL_NAME} MATCHES Flampr_flying-vanilla-bean_toffee@NFF2_.+_[0-9]+_proto)
assert(
${IC_FULL_NAME}
MATCHES
"Flampr_flying-vanilla-bean_toffee@NFF2_.+\\+?_[0-9a-fA-F]+\\+?_[0-9]+_proto"
)

foreach(ic_out_var ${ic_out})
unset("${ic_out_var}")
Expand All @@ -93,6 +97,11 @@ ic_project(
)

assert(1.0.0 STREQUAL ${IC_FW_VERSION})
assert(
${IC_FULL_NAME}
MATCHES
"Flumbr_Dipple_Snurp_3_FF3_1\.0\.0\\+?_[0-9a-fA-F]+\\+?_[0-9]+"
)

foreach(ic_out_var ${ic_out})
unset("${ic_out_var}")
Expand Down

0 comments on commit 9bfbc5a

Please sign in to comment.