Skip to content

Commit 07808eb

Browse files
authored
cmake : Do not install tools on iOS targets (#15903)
1 parent 6d75883 commit 07808eb

File tree

14 files changed

+54
-13
lines changed

14 files changed

+54
-13
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ if (MSVC)
5858
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/bigobj>")
5959
endif()
6060

61+
if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
62+
set(LLAMA_TOOLS_INSTALL_DEFAULT OFF)
63+
else()
64+
set(LLAMA_TOOLS_INSTALL_DEFAULT ${LLAMA_STANDALONE})
65+
endif()
66+
6167
#
6268
# option list
6369
#
@@ -82,6 +88,7 @@ option(LLAMA_BUILD_TESTS "llama: build tests" ${LLAMA_STANDALONE})
8288
option(LLAMA_BUILD_TOOLS "llama: build tools" ${LLAMA_STANDALONE})
8389
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
8490
option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
91+
option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_DEFAULT})
8592

8693
# 3rd party libs
8794
option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON)

tools/batched-bench/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-batched-bench)
22
add_executable(${TARGET} batched-bench.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-cvector-generator)
22
add_executable(${TARGET} cvector-generator.cpp pca.hpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/export-lora/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-export-lora)
22
add_executable(${TARGET} export-lora.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/gguf-split/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-gguf-split)
22
add_executable(${TARGET} gguf-split.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/imatrix/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-imatrix)
22
add_executable(${TARGET} imatrix.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/llama-bench/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-bench)
22
add_executable(${TARGET} llama-bench.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/main/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-cli)
22
add_executable(${TARGET} main.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

tools/mtmd/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ add_executable(llama-qwen2vl-cli deprecation-warning.cpp)
5555
set(TARGET llama-mtmd-cli)
5656
add_executable (${TARGET} mtmd-cli.cpp)
5757
set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME llama-mtmd-cli)
58-
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
58+
if(LLAMA_TOOLS_INSTALL)
5959
install(TARGETS ${TARGET} RUNTIME)
6060
endif()
6161
target_link_libraries (${TARGET} PRIVATE common mtmd Threads::Threads)

tools/perplexity/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
set(TARGET llama-perplexity)
22
add_executable(${TARGET} perplexity.cpp)
3-
install(TARGETS ${TARGET} RUNTIME)
43
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
54
target_compile_features(${TARGET} PRIVATE cxx_std_17)
5+
6+
if(LLAMA_TOOLS_INSTALL)
7+
install(TARGETS ${TARGET} RUNTIME)
8+
endif()

0 commit comments

Comments
 (0)