Require .git/ to be a folder for build-info.h

If llama.cpp is added as a project submodule, .git is a text file containing gitdir.
Adding extra backslash .git/ to if(EXISTS) makes it sure that .git/ is a folder containing index.
This commit is contained in:
kuvaus 2023-05-02 22:40:44 +03:00 committed by Green Sky
parent 67c77799e0
commit 431f1c5630
No known key found for this signature in database

View file

@ -90,7 +90,7 @@ file(WRITE "${CMAKE_BINARY_DIR}/BUILD_INFO.h.in" "\
# Generate initial build-info.h
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.cmake)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/")
# Add a custom target for build-info.h
add_custom_target(BUILD_INFO ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h")