mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-25 15:03:37 +03:00
GetGitRevisionDescription.cmake is a vendored copy of a file that many third-party CMake projects ship too. The copies are not interchangeable: this one takes git_describe(<var> <repo dir>) while the upstream one takes git_describe(<var>). Whichever copy is included first sets the include guard variable and every later include returns early. Since this build system includes its copy from the top level of the project, a component that vendors the upstream variant and calls git_describe(<var>) ends up calling this function without the repository argument and fails to configure with "Function invoked with incorrect arguments". Components currently work around it by clearing the guard variable, which only works if they know about it. Accept the one-argument form and resolve it against CMAKE_CURRENT_SOURCE_DIR, which is the directory of the caller, so the vendored copy describes the repository it actually lives in. The argument list is unchanged, so the existing git_describe(<var> <repo dir> [<extra git args>...]) calls keep working, and no public function is renamed.