Skip to content

Commit 9d1b20a

Browse files
committed
cmake : move llama.cpp compile flags to top level lists
ggml-ci
1 parent 9a03bc8 commit 9d1b20a

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

CMakeLists.txt

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,40 @@ llama_option_depr(WARNING LLAMA_SYCL_F16 GGML_SYCL_F16)
118118
llama_option_depr(WARNING LLAMA_CANN GGML_CANN)
119119

120120
#
121-
# build the library
121+
# 3rd party
122122
#
123123

124124
if (NOT TARGET ggml)
125125
add_subdirectory(ggml)
126126
# ... otherwise assume ggml is added by a parent CMakeLists.txt
127127
endif()
128+
129+
#
130+
# build the library
131+
#
132+
133+
llama_add_compile_flags() # llama-only flags
134+
128135
add_subdirectory(src)
129136

137+
#
138+
# utils, programs, examples and tests
139+
#
140+
141+
if (LLAMA_BUILD_COMMON)
142+
add_subdirectory(common)
143+
endif()
144+
145+
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
146+
include(CTest)
147+
add_subdirectory(tests)
148+
endif()
149+
150+
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
151+
add_subdirectory(examples)
152+
add_subdirectory(pocs)
153+
endif()
154+
130155
#
131156
# install
132157
#
@@ -200,21 +225,3 @@ configure_file(cmake/llama.pc.in
200225

201226
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc"
202227
DESTINATION lib/pkgconfig)
203-
204-
#
205-
# utils, programs, examples and tests
206-
#
207-
208-
if (LLAMA_BUILD_COMMON)
209-
add_subdirectory(common)
210-
endif()
211-
212-
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
213-
include(CTest)
214-
add_subdirectory(tests)
215-
endif()
216-
217-
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
218-
add_subdirectory(examples)
219-
add_subdirectory(pocs)
220-
endif()

common/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
find_package(Threads REQUIRED)
44

5-
llama_add_compile_flags()
6-
75
# Build info header
86
#
97

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ find_package(Threads REQUIRED)
88

99
# flags
1010

11-
llama_add_compile_flags()
11+
# ...
1212

1313
# examples
1414

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
llama_add_compile_flags()
2-
31
#
42
# libraries
53
#

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
llama_add_compile_flags()
2-
31
function(llama_test target)
42
include(CMakeParseArguments)
53
set(options)

0 commit comments

Comments
 (0)