Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 687e5bc

Browse files
committed
Revert "Harmonize cmake_policy() across standalone builds of all projects"
This reverts commit 88d7508. It's reported to break builds when symlinking other projects inside the `tools` directory.
1 parent 17c65e5 commit 687e5bc

8 files changed

Lines changed: 19 additions & 25 deletions

File tree

clang/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
cmake_minimum_required(VERSION 3.13.4)
2-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
3-
NO_POLICY_SCOPE)
42

53
# If we are not building as a part of LLVM, build Clang as an
64
# standalone project, using LLVM as an external library:

cmake/Modules/CMakePolicy.cmake

Lines changed: 0 additions & 12 deletions
This file was deleted.

flang/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
cmake_minimum_required(VERSION 3.13.4)
2-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
3-
NO_POLICY_SCOPE)
42

53
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
64

lld/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
cmake_minimum_required(VERSION 3.13.4)
2-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
3-
NO_POLICY_SCOPE)
42

53
# If we are not building as a part of LLVM, build LLD as an
64
# standalone project, using LLVM as an external library:

lldb/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
cmake_minimum_required(VERSION 3.13.4)
2-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
3-
NO_POLICY_SCOPE)
42

53
# Add path for custom modules.
64
set(CMAKE_MODULE_PATH

lldb/cmake/modules/LLDBStandalone.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()`
2+
# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html
3+
if(POLICY CMP0116)
4+
cmake_policy(SET CMP0116 OLD)
5+
endif()
6+
17
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
28
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
39
endif()

llvm/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# See docs/CMake.html for instructions about how to build LLVM with CMake.
22

33
cmake_minimum_required(VERSION 3.13.4)
4-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
5-
NO_POLICY_SCOPE)
4+
5+
# CMP0114: ExternalProject step targets fully adopt their steps.
6+
# New in CMake 3.19: https://cmake.org/cmake/help/latest/policy/CMP0114.html
7+
if(POLICY CMP0114)
8+
cmake_policy(SET CMP0114 OLD)
9+
endif()
10+
# CMP0116: Ninja generators transform `DEPFILE`s from `add_custom_command()`
11+
# New in CMake 3.20. https://cmake.org/cmake/help/latest/policy/CMP0116.html
12+
if(POLICY CMP0116)
13+
cmake_policy(SET CMP0116 OLD)
14+
endif()
615

716
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
817

mlir/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# MLIR project.
2-
cmake_minimum_required(VERSION 3.13.4)
3-
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/CMakePolicy.cmake
4-
NO_POLICY_SCOPE)
52

63
# Check if MLIR is built as a standalone project.
74
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
@@ -13,6 +10,8 @@ endif()
1310
include(GNUInstallDirs)
1411

1512
if(MLIR_STANDALONE_BUILD)
13+
cmake_minimum_required(VERSION 3.13.4)
14+
1615
find_package(LLVM CONFIG REQUIRED)
1716
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR})
1817
include(HandleLLVMOptions)

0 commit comments

Comments
 (0)