add check for GGML_STATIC and compile accordingly

This commit is contained in:
James Ravenscroft 2023-08-13 08:34:07 +01:00
parent c0cde10046
commit 2f0e2dee94

View File

@ -31,6 +31,14 @@ add_subdirectory(extern/ggml)
add_subdirectory(extern/argparse) add_subdirectory(extern/argparse)
add_subdirectory(extern/spdlog) add_subdirectory(extern/spdlog)
if (GGML_STATIC)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")
endif()
add_subdirectory(src) add_subdirectory(src)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)