Skip to content

Commit 0cc6af5

Browse files
iboBarthw
authored andcommitted
cmake : add option for common library (ggml-org#9661)
1 parent d6893bf commit 0cc6af5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ option(LLAMA_SANITIZE_THREAD "llama: enable thread sanitizer" OFF)
6262
option(LLAMA_SANITIZE_ADDRESS "llama: enable address sanitizer" OFF)
6363
option(LLAMA_SANITIZE_UNDEFINED "llama: enable undefined sanitizer" OFF)
6464

65+
# utils
66+
option(LLAMA_BUILD_COMMON "llama: build common utils library" ON)
67+
6568
# extra artifacts
6669
option(LLAMA_BUILD_TESTS "llama: build tests" ${LLAMA_STANDALONE})
6770
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
@@ -191,15 +194,17 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc"
191194
DESTINATION lib/pkgconfig)
192195

193196
#
194-
# programs, examples and tests
197+
# utils, programs, examples and tests
195198
#
196199

197-
add_subdirectory(common)
200+
if (LLAMA_BUILD_COMMON)
201+
add_subdirectory(common)
202+
endif()
198203

199204
if (LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
200205
include(CTest)
201206
add_subdirectory(tests)
202-
endif ()
207+
endif()
203208

204209
if (LLAMA_BUILD_EXAMPLES)
205210
add_subdirectory(examples)

0 commit comments

Comments
 (0)