mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-04 09:32:00 +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)
 | 
					llama_option_depr(WARNING     LLAMA_CANN                GGML_CANN)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# build the library
 | 
					# 3rd party
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (NOT TARGET ggml)
 | 
					if (NOT TARGET ggml)
 | 
				
			||||||
    add_subdirectory(ggml)
 | 
					    add_subdirectory(ggml)
 | 
				
			||||||
    # ... otherwise assume ggml is added by a parent CMakeLists.txt
 | 
					    # ... otherwise assume ggml is added by a parent CMakeLists.txt
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# build the library
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					llama_add_compile_flags() # llama-only flags
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(src)
 | 
					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
 | 
					# install
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -200,21 +225,3 @@ configure_file(cmake/llama.pc.in
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc"
 | 
					install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc"
 | 
				
			||||||
        DESTINATION lib/pkgconfig)
 | 
					        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)
 | 
					find_package(Threads REQUIRED)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
llama_add_compile_flags()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Build info header
 | 
					# Build info header
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@ find_package(Threads REQUIRED)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# flags
 | 
					# flags
 | 
				
			||||||
 | 
					
 | 
				
			||||||
llama_add_compile_flags()
 | 
					# ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# examples
 | 
					# examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,3 @@
 | 
				
			|||||||
llama_add_compile_flags()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# libraries
 | 
					# libraries
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,3 @@
 | 
				
			|||||||
llama_add_compile_flags()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function(llama_test target)
 | 
					function(llama_test target)
 | 
				
			||||||
    include(CMakeParseArguments)
 | 
					    include(CMakeParseArguments)
 | 
				
			||||||
    set(options)
 | 
					    set(options)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user