cmake : move llama.cpp compile flags to top level lists

ggml-ci
This commit is contained in:
Georgi Gerganov 2025-01-17 15:40:03 +02:00
parent 9a03bc811f
commit 9d1b20ad1a
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
5 changed files with 27 additions and 26 deletions

View File

@ -118,15 +118,40 @@ llama_option_depr(WARNING LLAMA_SYCL_F16 GGML_SYCL_F16)
llama_option_depr(WARNING LLAMA_CANN GGML_CANN)
#
# build the library
# 3rd party
#
if (NOT TARGET ggml)
add_subdirectory(ggml)
# ... otherwise assume ggml is added by a parent CMakeLists.txt
endif()
#
# build the library
#
llama_add_compile_flags() # llama-only flags
add_subdirectory(src)
#
# utils, programs, examples and tests
#
if (LLAMA_BUILD_COMMON)
add_subdirectory(common)
endif()
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
include(CTest)
add_subdirectory(tests)
endif()
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(pocs)
endif()
#
# install
#
@ -200,21 +225,3 @@ configure_file(cmake/llama.pc.in
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc"
DESTINATION lib/pkgconfig)
#
# utils, programs, examples and tests
#
if (LLAMA_BUILD_COMMON)
add_subdirectory(common)
endif()
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
include(CTest)
add_subdirectory(tests)
endif()
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(pocs)
endif()

View File

@ -2,8 +2,6 @@
find_package(Threads REQUIRED)
llama_add_compile_flags()
# Build info header
#

View File

@ -8,7 +8,7 @@ find_package(Threads REQUIRED)
# flags
llama_add_compile_flags()
# ...
# examples

View File

@ -1,5 +1,3 @@
llama_add_compile_flags()
#
# libraries
#

View File

@ -1,5 +1,3 @@
llama_add_compile_flags()
function(llama_test target)
include(CMakeParseArguments)
set(options)