mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-03 09:22:01 +00:00 
			
		
		
		
	cmake : move llama.cpp compile flags to top level lists
ggml-ci
This commit is contained in:
		@@ -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()
 | 
			
		||||
 
 | 
			
		||||
@@ -2,8 +2,6 @@
 | 
			
		||||
 | 
			
		||||
find_package(Threads REQUIRED)
 | 
			
		||||
 | 
			
		||||
llama_add_compile_flags()
 | 
			
		||||
 | 
			
		||||
# Build info header
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ find_package(Threads REQUIRED)
 | 
			
		||||
 | 
			
		||||
# flags
 | 
			
		||||
 | 
			
		||||
llama_add_compile_flags()
 | 
			
		||||
# ...
 | 
			
		||||
 | 
			
		||||
# examples
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,3 @@
 | 
			
		||||
llama_add_compile_flags()
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# libraries
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,3 @@
 | 
			
		||||
llama_add_compile_flags()
 | 
			
		||||
 | 
			
		||||
function(llama_test target)
 | 
			
		||||
    include(CMakeParseArguments)
 | 
			
		||||
    set(options)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user