[llvm-branch-commits] [llvm] c3403dc - [ASTMatchers] Fix build when no targets are enabled

Stephen Kelly via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 5 06:48:20 PST 2021


Author: Stephen Kelly
Date: 2021-01-05T14:40:35Z
New Revision: c3403dc63d73710d14844e8a8cfad7a0f52d4a54

URL: https://github.com/llvm/llvm-project/commit/c3403dc63d73710d14844e8a8cfad7a0f52d4a54
DIFF: https://github.com/llvm/llvm-project/commit/c3403dc63d73710d14844e8a8cfad7a0f52d4a54.diff

LOG: [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

Added: 
    

Modified: 
    llvm/cmake/modules/LLVM-Config.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake
index ebe13e7fc31c..5d9ec79c7c56 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)


        


More information about the llvm-branch-commits mailing list