mgorny updated this revision to Diff 470225. mgorny edited the summary of this revision. mgorny added a comment. Herald added a project: LLVM.
Use a shared policy file via `include()` instead. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136572/new/ https://reviews.llvm.org/D136572 Files: clang/CMakeLists.txt cmake/Modules/CMakePolicy.cmake flang/CMakeLists.txt lld/CMakeLists.txt lldb/CMakeLists.txt lldb/cmake/modules/LLDBStandalone.cmake llvm/CMakeLists.txt mlir/CMakeLists.txt
Index: mlir/CMakeLists.txt =================================================================== --- mlir/CMakeLists.txt +++ 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 @@ 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) Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -1,17 +1,8 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. cmake_minimum_required(VERSION 3.13.4) - -# CMP0114: ExternalProject step targets fully adopt their steps. -# New in CMake 3.19: https://cmake.org/cmake/help/latest/policy/CMP0114.html -if(POLICY CMP0114) - cmake_policy(SET CMP0114 OLD) -endif() -# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()` -# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html -if(POLICY CMP0116) - cmake_policy(SET CMP0116 OLD) -endif() +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) Index: lldb/cmake/modules/LLDBStandalone.cmake =================================================================== --- lldb/cmake/modules/LLDBStandalone.cmake +++ lldb/cmake/modules/LLDBStandalone.cmake @@ -1,9 +1,3 @@ -# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()` -# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html -if(POLICY CMP0116) - cmake_policy(SET CMP0116 OLD) -endif() - if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS) set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) endif() Index: lldb/CMakeLists.txt =================================================================== --- lldb/CMakeLists.txt +++ lldb/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) # Add path for custom modules. set(CMAKE_MODULE_PATH Index: lld/CMakeLists.txt =================================================================== --- lld/CMakeLists.txt +++ lld/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) # If we are not building as a part of LLVM, build LLD as an # standalone project, using LLVM as an external library: Index: flang/CMakeLists.txt =================================================================== --- flang/CMakeLists.txt +++ flang/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) Index: cmake/Modules/CMakePolicy.cmake =================================================================== --- /dev/null +++ cmake/Modules/CMakePolicy.cmake @@ -0,0 +1,12 @@ +# CMake policy settings shared between LLVM projects + +# CMP0114: ExternalProject step targets fully adopt their steps. +# New in CMake 3.19: https://cmake.org/cmake/help/latest/policy/CMP0114.html +if(POLICY CMP0114) + cmake_policy(SET CMP0114 OLD) +endif() +# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()` +# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html +if(POLICY CMP0116) + cmake_policy(SET CMP0116 OLD) +endif() Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) +include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake + NO_POLICY_SCOPE) # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits