diff --git a/CMakeLists.txt b/CMakeLists.txt index a4326377a0c..b483dd421b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,8 +64,12 @@ endif() # This allows an easy way of setting up a build directory for llvm and another # one for llvm+clang+... using the same sources. set(LLVM_ALL_PROJECTS "clang;clang-tools-extra;compiler-rt;debuginfo-tests;libc;libclc;libcxx;libcxxabi;libunwind;lld;lldb;mlir;openmp;parallel-libs;polly;pstl") +# The flang project is not yet part of "all" projects (see C++ requirements) +set(LLVM_EXTRA_PROJECTS "flang") +# List of all known projects in the mono repo +set(LLVM_KNOWN_PROJECTS "${LLVM_ALL_PROJECTS};${LLVM_EXTRA_PROJECTS}") set(LLVM_ENABLE_PROJECTS "" CACHE STRING - "Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".") + "Semicolon-separated list of projects to build (${LLVM_KNOWN_PROJECTS}), or \"all\".") if( LLVM_ENABLE_PROJECTS STREQUAL "all" ) set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS}) endif() @@ -89,7 +93,7 @@ mark_as_advanced(LLVM_ENABLE_PROJECTS_USED) if (LLVM_ENABLE_PROJECTS_USED OR NOT LLVM_ENABLE_PROJECTS STREQUAL "") set(LLVM_ENABLE_PROJECTS_USED ON CACHE BOOL "" FORCE) - foreach(proj ${LLVM_ALL_PROJECTS} ${LLVM_EXTERNAL_PROJECTS}) + foreach(proj ${LLVM_KNOWN_PROJECTS} ${LLVM_EXTERNAL_PROJECTS}) string(TOUPPER "${proj}" upper_proj) string(REGEX REPLACE "-" "_" upper_proj ${upper_proj}) if ("${proj}" IN_LIST LLVM_ENABLE_PROJECTS) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f419867cb08..b6d3b2c2fcb 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -37,6 +37,8 @@ add_llvm_external_project(clang) add_llvm_external_project(lld) add_llvm_external_project(lldb) add_llvm_external_project(mlir) +# Flang depends on mlir, so place it afterward +add_llvm_external_project(flang) # Automatically add remaining sub-directories containing a 'CMakeLists.txt' # file as external projects.