mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 10:40:47 +03:00
feat(cmakev2/idf): add __git_init to identify the git executable
The Git tool will be used in various parts of the build system, such as retrieving the IDF version using git-describe or checking submodules. Similar to the Python interpreter, add an initialization function to identify the Git executable. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -49,6 +49,24 @@ function(__init_idf_path)
|
||||
set(ENV{IDF_PATH} ${idf_path})
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__init_git()
|
||||
|
||||
Determine the executable.
|
||||
|
||||
Set the GIT build property.
|
||||
#]]
|
||||
function(__init_git)
|
||||
find_package(Git)
|
||||
if(NOT GIT_FOUND)
|
||||
idf_build_set_property(GIT NOTFOUND)
|
||||
idf_warn("Git executable not found.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
idf_build_set_property(GIT "${GIT_EXECUTABLE}")
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__init_python()
|
||||
|
||||
@@ -332,6 +350,9 @@ idf_build_set_property(BUILD_DIR "${CMAKE_BINARY_DIR}")
|
||||
# well as a build property.
|
||||
__init_idf_path()
|
||||
|
||||
# Determine git executable and set GIT build property.
|
||||
__init_git()
|
||||
|
||||
# Determine the Python interpreter and check package dependencies if necessary.
|
||||
__init_python()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user