From c3403dc63d73710d14844e8a8cfad7a0f52d4a54 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 26 Dec 2020 21:11:21 +0000 Subject: [PATCH] [ASTMatchers] Fix build when no targets are enabled This makes sense to do when building only tools like clang-tidy for example. Differential Revision: https://reviews.llvm.org/D93987 --- llvm/cmake/modules/LLVM-Config.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake index ebe13e7..5d9ec79 100644 --- a/llvm/cmake/modules/LLVM-Config.cmake +++ b/llvm/cmake/modules/LLVM-Config.cmake @@ -28,7 +28,9 @@ function(is_llvm_target_library library return_var) string(TOUPPER "${LLVM_TARGETS_TO_BUILD}" targets) elseif(ARG_OMITTED_TARGETS) set(omitted_targets ${LLVM_ALL_TARGETS}) - list(REMOVE_ITEM omitted_targets ${LLVM_TARGETS_TO_BUILD}) + if (LLVM_TARGETS_TO_BUILD) + list(REMOVE_ITEM omitted_targets ${LLVM_TARGETS_TO_BUILD}) + endif() string(TOUPPER "${omitted_targets}" targets) else() string(TOUPPER "${LLVM_ALL_TARGETS}" targets) -- 2.7.4