mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: Trim IDF_VER to fit a 32-bit field
This commit is contained in:
parent
53208f6324
commit
f8ca296438
@ -223,11 +223,13 @@ endfunction()
|
||||
function(idf_get_git_revision)
|
||||
git_describe(IDF_VER_GIT "${IDF_PATH}")
|
||||
if(EXISTS "${IDF_PATH}/version.txt")
|
||||
file(STRINGS "${IDF_PATH}/version.txt" IDF_VER)
|
||||
file(STRINGS "${IDF_PATH}/version.txt" IDF_VER_T)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${IDF_PATH}/version.txt")
|
||||
else()
|
||||
set(IDF_VER ${IDF_VER_GIT})
|
||||
set(IDF_VER_T ${IDF_VER_GIT})
|
||||
endif()
|
||||
# cut IDF_VER to required 32 characters.
|
||||
string(SUBSTRING "${IDF_VER_T}" 0 31 IDF_VER)
|
||||
message(STATUS "IDF_VER: ${IDF_VER}")
|
||||
add_definitions(-DIDF_VER=\"${IDF_VER}\")
|
||||
git_submodule_check("${IDF_PATH}")
|
||||
|
Loading…
Reference in New Issue
Block a user