diff --git a/CMakeLists.txt b/CMakeLists.txt index a717a508f..622958dde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index df1cdf9a5..01c00e277 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -2,8 +2,6 @@ find_package(Threads REQUIRED) -llama_add_compile_flags() - # Build info header # diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 66cfab2c3..f8395b59f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(Threads REQUIRED) # flags -llama_add_compile_flags() +# ... # examples diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aeb75bf3e..ea9fbd870 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -llama_add_compile_flags() - # # libraries # diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3fa43c295..2b5e5fd4a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,3 @@ -llama_add_compile_flags() - function(llama_test target) include(CMakeParseArguments) set(options)