diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-10-24 06:31:37 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-10-27 13:46:56 +0200 |
commit | 88d7508dc479210f07abccb17f0194b66264b125 (patch) | |
tree | 59746b6b1e9baa88cc12665229414f63c381536d /mlir/CMakeLists.txt | |
parent | 7ab21cdc208491c5f935b9fbc18c3436a6e14c1f (diff) | |
download | llvm-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.txt | 5 |
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) |