From: Kerfuffle Date: Sat, 17 Jun 2023 07:49:42 +0000 (-0600) Subject: Allow cmake to build ggml as a library (#1896) X-Git-Tag: gguf-v0.4.0~615 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b4c6f46f17b6e02f1cd55a81339e7e64f3aaa688;p=pkg%2Fggml%2Fsources%2Fllama.cpp Allow cmake to build ggml as a library (#1896) * Allow cmake to build ggml as a library * A ggml_static library will be created * When BUILD_SHARED_LIBS is enabled, ggml_shared will also be built --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 935fba83..f5a96853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -461,8 +461,10 @@ target_include_directories(ggml PUBLIC . ${LLAMA_EXTRA_INCLUDES}) target_compile_features(ggml PUBLIC c_std_11) # don't bump target_link_libraries(ggml PUBLIC Threads::Threads ${LLAMA_EXTRA_LIBS}) +add_library(ggml_static STATIC $) if (BUILD_SHARED_LIBS) set_target_properties(ggml PROPERTIES POSITION_INDEPENDENT_CODE ON) + add_library(ggml_shared SHARED $) endif() add_library(llama