Guard against adding to cache variable twice
This commit is contained in:
parent
b14e8294b1
commit
ea0a85abae
2 changed files with 9 additions and 6 deletions
|
@ -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,10 +252,14 @@ 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}"
|
||||||
else()
|
|
||||||
set(GGML_AVAILABLE_BACKENDS "${GGML_AVAILABLE_BACKENDS};${backend}"
|
|
||||||
CACHE INTERNAL "List of backends for cmake package")
|
CACHE INTERNAL "List of backends for cmake package")
|
||||||
|
else()
|
||||||
|
list(FIND GGML_AVAILABLE_BACKENDS "${backend}" has_backend)
|
||||||
|
if(has_backend EQUAL -1)
|
||||||
|
set(GGML_AVAILABLE_BACKENDS "${GGML_AVAILABLE_BACKENDS};${backend}"
|
||||||
|
CACHE INTERNAL "List of backends for cmake package")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue