]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake : do not build common library by default when standalone (#9804)
authorDiego Devesa <redacted>
Wed, 9 Oct 2024 16:49:52 +0000 (18:49 +0200)
committerGitHub <redacted>
Wed, 9 Oct 2024 16:49:52 +0000 (18:49 +0200)
CMakeLists.txt
examples/llama.android/llama/build.gradle.kts

index 415743c2afe3f04b6d84254ad1b77d6a2e7db3ef..64a335378e5962939e542c230e91f249621b6463 100644 (file)
@@ -63,7 +63,7 @@ option(LLAMA_SANITIZE_ADDRESS   "llama: enable address sanitizer"   OFF)
 option(LLAMA_SANITIZE_UNDEFINED "llama: enable undefined sanitizer" OFF)
 
 # utils
-option(LLAMA_BUILD_COMMON "llama: build common utils library" ON)
+option(LLAMA_BUILD_COMMON "llama: build common utils library" ${LLAMA_STANDALONE})
 
 # extra artifacts
 option(LLAMA_BUILD_TESTS    "llama: build tests"          ${LLAMA_STANDALONE})
@@ -201,12 +201,12 @@ if (LLAMA_BUILD_COMMON)
     add_subdirectory(common)
 endif()
 
-if (LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
+if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TESTS AND NOT CMAKE_JS_VERSION)
     include(CTest)
     add_subdirectory(tests)
 endif()
 
-if (LLAMA_BUILD_EXAMPLES)
+if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
     add_subdirectory(examples)
     add_subdirectory(pocs)
 endif()
index 0a3806172f05f7ee1ce3cae67535c042d2c40080..2d1dfba2040da5b6aa4f277c8b29da6b109d01da 100644 (file)
@@ -18,6 +18,7 @@ android {
         }
         externalNativeBuild {
             cmake {
+                arguments += "-DLLAMA_BUILD_COMMON=ON"
                 arguments += "-DCMAKE_BUILD_TYPE=Release"
                 cppFlags += listOf()
                 arguments += listOf()