summaryrefslogtreecommitdiff
path: root/mlir/CMakeLists.txt
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-10-24 06:31:37 +0200
committerMichał Górny <mgorny@gentoo.org>2022-10-27 13:46:56 +0200
commit88d7508dc479210f07abccb17f0194b66264b125 (patch)
tree59746b6b1e9baa88cc12665229414f63c381536d /mlir/CMakeLists.txt
parent7ab21cdc208491c5f935b9fbc18c3436a6e14c1f (diff)
downloadllvm-88d7508dc479210f07abccb17f0194b66264b125.tar.gz
Harmonize cmake_policy() across standalone builds of all projects
Move `cmake_policy()` settings from `llvm/CMakeLists.txt` into a shared `cmake/modules/CMakePolicy.cmake`. Include it from all relevant projects that support standalone builds, in order to ensure that the policies are consistently set whether they are built in-tree or stand-alone. Differential Revision: https://reviews.llvm.org/D136572
Diffstat (limited to 'mlir/CMakeLists.txt')
-rw-r--r--mlir/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 5b6650d182a5..33988682c823 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -1,4 +1,7 @@
# MLIR project.
+cmake_minimum_required(VERSION 3.13.4)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
+ NO_POLICY_SCOPE)
# Check if MLIR is built as a standalone project.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
@@ -10,8 +13,6 @@ endif()
include(GNUInstallDirs)
if(MLIR_STANDALONE_BUILD)
- cmake_minimum_required(VERSION 3.13.4)
-
find_package(LLVM CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR})
include(HandleLLVMOptions)