From 431f1c5630e6c804712f0a211419dece57785eb1 Mon Sep 17 00:00:00 2001 From: kuvaus <22169537+kuvaus@users.noreply.github.com> Date: Tue, 2 May 2023 22:40:44 +0300 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53d48a6c5..13e39c31c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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")