Skip to content

Commit 3a00c98

Browse files
authored
cmake : fix KleidiAI install target failure with EXCLUDE_FROM_ALL (#19581)
* cmake: fix KleidiAI install target failure with EXCLUDE_FROM_ALL Fix for the bug #19501 by adding EXCLUDE_FROM_ALL to FetchContent_Declare. This properly excludes KleidiAI from both build and install targets, preventing install failures when GGML_CPU_KLEIDIAI=ON is used. The KleidiAI source files are still compiled into libggml-cpu.so, preserving all functionality. * addressed code review comments
1 parent 079feab commit 3a00c98

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

ggml/src/ggml-cpu/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,14 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
569569
cmake_policy(SET CMP0135 NEW)
570570
endif()
571571

572+
# TODO: Use FetchContent_MakeAvailable with EXCLUDE_FROM_ALL after bumping minimum CMake version to 3.28+
573+
# Using FetchContent_Populate instead to avoid EXCLUDE_FROM_ALL which requires CMake 3.28
572574
FetchContent_Declare(KleidiAI_Download
573575
URL ${KLEIDIAI_DOWNLOAD_URL}
574576
DOWNLOAD_EXTRACT_TIMESTAMP NEW
575577
URL_HASH MD5=${KLEIDIAI_ARCHIVE_MD5})
576578

577-
FetchContent_MakeAvailable(KleidiAI_Download)
579+
FetchContent_Populate(KleidiAI_Download)
578580
FetchContent_GetProperties(KleidiAI_Download
579581
SOURCE_DIR KLEIDIAI_SRC
580582
POPULATED KLEIDIAI_POPULATED)
@@ -585,11 +587,6 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
585587

586588
add_compile_definitions(GGML_USE_CPU_KLEIDIAI)
587589

588-
# Remove kleidiai target after fetching it
589-
if (TARGET kleidiai)
590-
set_target_properties(kleidiai PROPERTIES EXCLUDE_FROM_ALL TRUE)
591-
endif()
592-
593590
list(APPEND GGML_CPU_SOURCES
594591
ggml-cpu/kleidiai/kleidiai.cpp
595592
ggml-cpu/kleidiai/kernels.cpp

0 commit comments

Comments
 (0)