cmake : add variable to skip installing tests (#19370)
When packaging downstream, there's usually little point in installing test. The default behaviour remains the same.
This commit is contained in:
parent
39bf692af1
commit
1e8924fd65
|
|
@ -109,6 +109,7 @@ option(LLAMA_BUILD_TOOLS "llama: build tools" ${LLAMA_STANDALONE})
|
||||||
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
|
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
|
||||||
option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
|
option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
|
||||||
option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_DEFAULT})
|
option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_DEFAULT})
|
||||||
|
option(LLAMA_TESTS_INSTALL "llama: install tests" ON)
|
||||||
|
|
||||||
# 3rd party libs
|
# 3rd party libs
|
||||||
option(LLAMA_HTTPLIB "llama: httplib for downloading functionality" ON)
|
option(LLAMA_HTTPLIB "llama: httplib for downloading functionality" ON)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@ function(llama_build source)
|
||||||
|
|
||||||
add_executable(${TEST_TARGET} ${TEST_SOURCES})
|
add_executable(${TEST_TARGET} ${TEST_SOURCES})
|
||||||
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
||||||
install(TARGETS ${TEST_TARGET} RUNTIME)
|
if (LLAMA_TESTS_INSTALL)
|
||||||
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(llama_test target)
|
function(llama_test target)
|
||||||
|
|
@ -100,7 +102,9 @@ function(llama_build_and_test source)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${TEST_TARGET} ${TEST_SOURCES})
|
add_executable(${TEST_TARGET} ${TEST_SOURCES})
|
||||||
install(TARGETS ${TEST_TARGET} RUNTIME)
|
if (LLAMA_TESTS_INSTALL)
|
||||||
|
install(TARGETS ${TEST_TARGET} RUNTIME)
|
||||||
|
endif()
|
||||||
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
target_link_libraries(${TEST_TARGET} PRIVATE common)
|
||||||
|
|
||||||
add_test(
|
add_test(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue