[llvm] 0c9b32e - [llvm][Cmake] Expand "all" in LLVM_ENABLE_PROJECTS before other checks
Kadir Cetinkaya via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 23 06:46:15 PDT 2022
Author: Kadir Cetinkaya
Date: 2022-08-23T15:45:55+02:00
New Revision: 0c9b32e7dd2d3488156234cfc4278e7119635378
URL: https://github.com/llvm/llvm-project/commit/0c9b32e7dd2d3488156234cfc4278e7119635378
DIFF: https://github.com/llvm/llvm-project/commit/0c9b32e7dd2d3488156234cfc4278e7119635378.diff
LOG: [llvm][Cmake] Expand "all" in LLVM_ENABLE_PROJECTS before other checks
Differential Revision: https://reviews.llvm.org/D132454
Added:
Modified:
llvm/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e3f81cb4d627..c9cbf420fdc3 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -116,8 +116,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\".")
+# Make sure expansion happens first to not handle "all" in rest of the checks.
+if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
+ set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
+endif()
foreach(proj ${LLVM_ENABLE_PROJECTS})
- if (NOT proj STREQUAL "all" AND NOT proj STREQUAL "llvm" AND NOT "${proj}" IN_LIST LLVM_KNOWN_PROJECTS)
+ if (NOT proj STREQUAL "llvm" AND NOT "${proj}" IN_LIST LLVM_KNOWN_PROJECTS)
MESSAGE(FATAL_ERROR "${proj} isn't a known project: ${LLVM_KNOWN_PROJECTS}")
endif()
endforeach()
@@ -131,10 +135,6 @@ foreach(proj "libcxx" "libcxxabi" "libunwind")
endif()
endforeach()
-if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
- set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
-endif()
-
if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
if (NOT "mlir" IN_LIST LLVM_ENABLE_PROJECTS)
message(STATUS "Enabling MLIR as a dependency to flang")
More information about the llvm-commits
mailing list