[llvm] 713c768 - Check for invalid projects passed in LLVM_ENABLE_PROJECTS

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 18 11:11:41 PDT 2021


Author: Mehdi Amini
Date: 2021-09-18T18:11:30Z
New Revision: 713c768a6d0e385be0f14816494d146bd32ea731

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

LOG: Check for invalid projects passed in LLVM_ENABLE_PROJECTS

This is catching misconfiguration. For example one of my automation
had a typo running `-DLLVM_ENABLE_PROJECTS=nlir` and it was just
silently ignored. Instead, an error will now be displayed.

Recommit 4121ac1e after fixing it to not fail on "all"

Differential Revision: https://reviews.llvm.org/D110016

Added: 
    

Modified: 
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index c48f50639d83..a89bea48b6f9 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -71,6 +71,12 @@ set(LLVM_EXTRA_PROJECTS "flang")
 set(LLVM_KNOWN_PROJECTS "${LLVM_ALL_PROJECTS};${LLVM_EXTRA_PROJECTS}")
 set(LLVM_ENABLE_PROJECTS "" CACHE STRING
 	"Semicolon-separated list of projects to build (${LLVM_KNOWN_PROJECTS}), or \"all\".")
+foreach(proj ${LLVM_ENABLE_PROJECTS})
+  if (NOT proj STREQUAL "all" AND NOT proj STREQUAL "llvm" AND NOT "${proj}" IN_LIST LLVM_KNOWN_PROJECTS)
+     MESSAGE(FATAL_ERROR "${proj} isn't a know project: ${LLVM_KNOWN_PROJECTS}")
+  endif()
+endforeach()
+
 if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
   set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
 endif()


        


More information about the llvm-commits mailing list