cmake: prefer `version.txt` for IDF_VER if available

pull/2429/head
Mahavir Jain 2018-09-14 17:02:37 +05:30
rodzic 8d537432fd
commit 4ec9aa9a00
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -213,7 +213,11 @@ endfunction()
# Running git_describe() here automatically triggers rebuilds # Running git_describe() here automatically triggers rebuilds
# if the ESP-IDF git version changes # if the ESP-IDF git version changes
function(idf_get_git_revision) function(idf_get_git_revision)
git_describe(IDF_VER "${IDF_PATH}") if(EXISTS "${IDF_PATH}/version.txt")
file(STRINGS "${IDF_PATH}/version.txt" IDF_VER)
else()
git_describe(IDF_VER "${IDF_PATH}")
endif()
add_definitions(-DIDF_VER=\"${IDF_VER}\") add_definitions(-DIDF_VER=\"${IDF_VER}\")
git_submodule_check("${IDF_PATH}") git_submodule_check("${IDF_PATH}")
set(IDF_VER ${IDF_VER} PARENT_SCOPE) set(IDF_VER ${IDF_VER} PARENT_SCOPE)