aboutsummaryrefslogtreecommitdiff
path: root/clang/CMakeLists.txt
diff options
context:
space:
mode:
authorNathan Lanza <nathanlanza@gmail.com>2024-04-11 16:56:31 -0400
committerGitHub <noreply@github.com>2024-04-11 16:56:31 -0400
commit44de2bb6949f0ca62a2e16506fe3d91be14e6d23 (patch)
tree3b5e7232a62e6dece9c3f1279befbd713b62e698 /clang/CMakeLists.txt
parent1f5d130df85c2d0550dc8687ad0fa1d96856c318 (diff)
downloadllvm-44de2bb6949f0ca62a2e16506fe3d91be14e6d23.zip
llvm-44de2bb6949f0ca62a2e16506fe3d91be14e6d23.tar.gz
llvm-44de2bb6949f0ca62a2e16506fe3d91be14e6d23.tar.bz2
[CIR][cmake] Add support for cmake variable CLANG_ENABLE_CIR
Introduce a cmake variable that guards the inclusion of ClangIR into the build of clang. Guard that we aren't trying to build without MLIR. Add two subdirectories that, as of now, don't do anything. Reviewers: bcardosolopes, erichkeane, petrhosek, Ericson2314 Reviewed By: bcardosolopes Pull Request: https://github.com/llvm/llvm-project/pull/86078
Diffstat (limited to 'clang/CMakeLists.txt')
-rw-r--r--clang/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 284b2af..f092766 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -165,6 +165,13 @@ if(CLANG_ENABLE_LIBXML2)
endif()
endif()
+if(CLANG_ENABLE_CIR)
+ if (NOT "${LLVM_ENABLE_PROJECTS}" MATCHES "MLIR|mlir")
+ message(FATAL_ERROR
+ "Cannot build ClangIR without MLIR in LLVM_ENABLE_PROJECTS")
+ endif()
+endif()
+
include(CheckIncludeFile)
check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)