From f8ca296438857ce0f77006e26ba675a16be6a8b0 Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Wed, 13 Mar 2019 20:04:43 +0800 Subject: [PATCH] cmake: Trim IDF_VER to fit a 32-bit field --- tools/cmake/idf_functions.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cmake/idf_functions.cmake b/tools/cmake/idf_functions.cmake index 3ea818ec80..01035a0b17 100644 --- a/tools/cmake/idf_functions.cmake +++ b/tools/cmake/idf_functions.cmake @@ -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}") -- 2.40.0