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.
This commit is contained in:
parent
431f1c5630
commit
e06f9b86ec
1 changed files with 1 additions and 11 deletions
|
@ -90,19 +90,9 @@ file(WRITE "${CMAKE_BINARY_DIR}/BUILD_INFO.h.in" "\
|
||||||
# Generate initial build-info.h
|
# Generate initial build-info.h
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.cmake)
|
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 a custom target for build-info.h
|
||||||
add_custom_target(BUILD_INFO ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h")
|
add_custom_target(BUILD_INFO ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h")
|
||||||
|
|
||||||
# Add a custom command to rebuild build-info.h when .git/index changes
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/build-info.h"
|
|
||||||
COMMENT "Generating build details from Git"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/scripts/build-info.cmake"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/.git/index"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
else()
|
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.")
|
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.")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue