]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake : handle cases where git index is not found in .git (#5844)
authorDane Madsen <redacted>
Mon, 4 Mar 2024 18:26:55 +0000 (05:26 +1100)
committerGitHub <redacted>
Mon, 4 Mar 2024 18:26:55 +0000 (20:26 +0200)
* Update CMakeLists.txt

* Update CMakeLists.txt

common/CMakeLists.txt

index f79acfef1d1336d7814d8bc5f68892d23b763899..350bbdf7f7b1bd7164ed907cbe48652b1c1b21f4 100644 (file)
@@ -19,7 +19,12 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../.git")
         endif()
     endif()
 
-    set(GIT_INDEX "${GIT_DIR}/index")
+    if(EXISTS "${GIT_DIR}/index")
+        set(GIT_INDEX "${GIT_DIR}/index")
+    else()
+        message(WARNING "Git index not found in git repository.")
+        set(GIT_INDEX "")
+    endif()
 else()
     message(WARNING "Git repository not found; to enable automatic generation of build info, make sure Git is installed and the project is a Git repository.")
     set(GIT_INDEX "")