Skip to content

Commit 3e55df6

Browse files
authored
Remove custom command
Removed custom command to rebuild build-info.h when .git/index changes. No longer triggers cmake compilation error if llama.cpp is included as a submodule.
1 parent e6f4de3 commit 3e55df6

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,9 @@ file(WRITE "${CMAKE_BINARY_DIR}/BUILD_INFO.h.in" "\
9090
# Generate initial build-info.h
9191
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.cmake)
9292

93-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/")
93+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
9494
# Add a custom target for build-info.h
9595
add_custom_target(BUILD_INFO ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h")
96-
97-
# Add a custom command to rebuild build-info.h when .git/index changes
98-
add_custom_command(
99-
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h"
100-
COMMENT "Generating build details from Git"
101-
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.cmake"
102-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
103-
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.git/index"
104-
VERBATIM
105-
)
10696
else()
10797
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.")
10898
endif()

0 commit comments

Comments
 (0)