mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-31 06:03:11 +01:00
Guard against adding to cache variable twice
This commit is contained in:
parent
b14e8294b1
commit
ea0a85abae
@ -278,9 +278,8 @@ execute_process(COMMAND ${GIT_EXE} rev-list --count HEAD
|
|||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${GGML_BUILD_NUMBER} EQUAL 1)
|
if(GGML_BUILD_NUMBER EQUAL 1)
|
||||||
message(WARNING
|
message(WARNING "GGML build version fixed at 1 likely due to a shallow clone.")
|
||||||
"GGML build version fixed at 1 likely due to a shallow clone.")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
execute_process(COMMAND ${GIT_EXE} rev-parse --short HEAD
|
execute_process(COMMAND ${GIT_EXE} rev-parse --short HEAD
|
||||||
|
@ -252,11 +252,15 @@ function(ggml_add_backend_library backend)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT GGML_AVAILABLE_BACKENDS)
|
if(NOT GGML_AVAILABLE_BACKENDS)
|
||||||
set(GGML_AVAILABLE_BACKENDS "${backend}" CACHE INTERNAL "List of backends for cmake package")
|
set(GGML_AVAILABLE_BACKENDS "${backend}"
|
||||||
|
CACHE INTERNAL "List of backends for cmake package")
|
||||||
else()
|
else()
|
||||||
|
list(FIND GGML_AVAILABLE_BACKENDS "${backend}" has_backend)
|
||||||
|
if(has_backend EQUAL -1)
|
||||||
set(GGML_AVAILABLE_BACKENDS "${GGML_AVAILABLE_BACKENDS};${backend}"
|
set(GGML_AVAILABLE_BACKENDS "${GGML_AVAILABLE_BACKENDS};${backend}"
|
||||||
CACHE INTERNAL "List of backends for cmake package")
|
CACHE INTERNAL "List of backends for cmake package")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(ggml_add_backend backend)
|
function(ggml_add_backend backend)
|
||||||
|
Loading…
Reference in New Issue
Block a user