Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cbaa359

Browse files
committedMay 27, 2023
Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e. Adds the patch by @hans from #62719 This patch fixes the Windows build. d763c6e reverted the reviews D144509 [CMake] Bumps minimum version to 3.20.0. This partly undoes D137724. This change has been discussed on discourse https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193 Note this does not remove work-arounds for older CMake versions, that will be done in followup patches. D150532 [OpenMP] Compile assembly files as ASM, not C Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent) when compiling a file which has been set as having the language C. This behaviour change only takes place if "cmake_minimum_required" is set to 3.20 or newer, or if the policy CMP0119 is set to new. Attempting to compile assembly files with "-x c" fails, however this is workarounded in many cases, as OpenMP overrides this with "-x assembler-with-cpp", however this is only added for non-Windows targets. Thus, after increasing cmake_minimum_required to 3.20, this breaks compiling the GNU assembly for Windows targets; the GNU assembly is used for ARM and AArch64 Windows targets when building with Clang. This patch unbreaks that. D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump The build uses other mechanism to select the runtime. Fixes #62719 Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D151344
1 parent a218c99 commit cbaa359

File tree

38 files changed

+58
-143
lines changed

38 files changed

+58
-143
lines changed
 

‎bolt/runtime/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22
include(CheckIncludeFiles)
33
include(GNUInstallDirs)
44

‎clang/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
44
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -11,13 +11,6 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
1111
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1212
project(Clang)
1313
set(CLANG_BUILT_STANDALONE TRUE)
14-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
15-
message(WARNING
16-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
17-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
18-
"using an older CMake will become an error. Please upgrade your CMake to "
19-
"at least 3.20.0 now to avoid issues in the future!")
20-
endif()
2114
endif()
2215

2316
# Must go below project(..)

‎clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project(exec C)
22

3-
cmake_minimum_required(VERSION 3.13.4)
3+
cmake_minimum_required(VERSION 3.20.0)
44

55
include(CheckCCompilerFlag)
66
check_c_compiler_flag("-std=c99" C99_SUPPORTED)

‎cmake/Modules/CMakePolicy.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CMake policy settings shared between LLVM projects
22

3+
# CMP0091: MSVC runtime library flags are selected by an abstraction.
4+
# New in CMake 3.15. https://cmake.org/cmake/help/latest/policy/CMP0091.html
5+
if(POLICY CMP0091)
6+
cmake_policy(SET CMP0091 OLD)
7+
endif()
38
# CMP0114: ExternalProject step targets fully adopt their steps.
49
# New in CMake 3.19: https://cmake.org/cmake/help/latest/policy/CMP0114.html
510
if(POLICY CMP0114)

‎compiler-rt/CMakeLists.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,19 @@
33
# An important constraint of the build is that it only produces libraries
44
# based on the ability of the host toolchain to target various platforms.
55

6-
cmake_minimum_required(VERSION 3.13.4)
6+
cmake_minimum_required(VERSION 3.20.0)
7+
8+
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
9+
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
10+
NO_POLICY_SCOPE)
711

812
# Check if compiler-rt is built as a standalone project.
913
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
1014
project(CompilerRT C CXX ASM)
1115
set(COMPILER_RT_STANDALONE_BUILD TRUE)
1216
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
13-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
14-
message(WARNING
15-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
16-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
17-
"using an older CMake will become an error. Please upgrade your CMake to "
18-
"at least 3.20.0 now to avoid issues in the future!")
19-
endif()
2017
endif()
2118

22-
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
23-
2419
# Add path for custom compiler-rt modules.
2520
list(INSERT CMAKE_MODULE_PATH 0
2621
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"

‎compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
# architecture-specific code in various subdirectories.
44

55
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
6-
cmake_minimum_required(VERSION 3.13.4)
7-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
8-
message(WARNING
9-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
10-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
11-
"using an older CMake will become an error. Please upgrade your CMake to "
12-
"at least 3.20.0 now to avoid issues in the future!")
13-
endif()
6+
cmake_minimum_required(VERSION 3.20.0)
147

158
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
169
project(CompilerRTBuiltins C ASM)

‎compiler-rt/lib/crt/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
2-
cmake_minimum_required(VERSION 3.13.4)
3-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
4-
message(WARNING
5-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
6-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
7-
"using an older CMake will become an error. Please upgrade your CMake to "
8-
"at least 3.20.0 now to avoid issues in the future!")
9-
endif()
2+
cmake_minimum_required(VERSION 3.20.0)
103

114
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
125
project(CompilerRTCRT C)

‎flang/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
44
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -39,13 +39,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3939
message("Building Flang as a standalone project.")
4040
project(Flang)
4141
set(FLANG_STANDALONE_BUILD ON)
42-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
43-
message(WARNING
44-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
45-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
46-
"using an older CMake will become an error. Please upgrade your CMake to "
47-
"at least 3.20.0 now to avoid issues in the future!")
48-
endif()
4942
else()
5043
set(FLANG_STANDALONE_BUILD OFF)
5144
endif()

‎flang/lib/Decimal/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
2-
cmake_minimum_required(VERSION 3.13.4)
2+
cmake_minimum_required(VERSION 3.20.0)
33

44
project(FortranDecimal C CXX)
55

‎flang/runtime/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@
77
#===------------------------------------------------------------------------===#
88

99
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
10-
cmake_minimum_required(VERSION 3.13.4)
11-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
12-
message(WARNING
13-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
14-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
15-
"using an older CMake will become an error. Please upgrade your CMake to "
16-
"at least 3.20.0 now to avoid issues in the future!")
17-
endif()
10+
cmake_minimum_required(VERSION 3.20.0)
1811

1912
project(FlangRuntime C CXX)
2013

‎libc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
# Include LLVM's cmake policies.
44
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)

‎libc/examples/hello_world/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project(hello_world)
2-
cmake_minimum_required(VERSION 3.13.4)
2+
cmake_minimum_required(VERSION 3.20.0)
33
include(../examples.cmake)
44

55
add_example(

‎libclc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
project( libclc VERSION 0.2.0 LANGUAGES CXX C)
44

‎libcxx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#===============================================================================
55
# Setup Project
66
#===============================================================================
7-
cmake_minimum_required(VERSION 3.13.4)
7+
cmake_minimum_required(VERSION 3.20.0)
88

99
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
1010

‎libcxxabi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Setup Project
55
#===============================================================================
66

7-
cmake_minimum_required(VERSION 3.13.4)
7+
cmake_minimum_required(VERSION 3.20.0)
88

99
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
1010

‎libunwind/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Setup Project
33
#===============================================================================
44

5-
cmake_minimum_required(VERSION 3.13.4)
5+
cmake_minimum_required(VERSION 3.20.0)
66

77
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
88

‎libunwind/src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ set(LIBUNWIND_ASM_SOURCES
3030
# CMake doesn't work correctly with assembly on AIX. Workaround by compiling
3131
# as C files as well.
3232
if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR
33-
(MINGW AND CMAKE_VERSION VERSION_LESS 3.17) OR
34-
(${CMAKE_SYSTEM_NAME} MATCHES "AIX"))
33+
(MINGW AND CMAKE_VERSION VERSION_LESS 3.17))
3534
set_source_files_properties(${LIBUNWIND_ASM_SOURCES} PROPERTIES LANGUAGE C)
3635
endif()
3736

‎lld/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
44
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -11,13 +11,6 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
1111
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1212
project(lld)
1313
set(LLD_BUILT_STANDALONE TRUE)
14-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
15-
message(WARNING
16-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
17-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
18-
"using an older CMake will become an error. Please upgrade your CMake to "
19-
"at least 3.20.0 now to avoid issues in the future!")
20-
endif()
2114
endif()
2215

2316
# Must go below project(..)

‎lldb/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
44
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -19,13 +19,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1919
project(lldb)
2020
set(LLDB_BUILT_STANDALONE TRUE)
2121
set(LLVM_INCLUDE_TESTS ON CACHE INTERNAL "")
22-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
23-
message(WARNING
24-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
25-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
26-
"using an older CMake will become an error. Please upgrade your CMake to "
27-
"at least 3.20.0 now to avoid issues in the future!")
28-
endif()
2922
endif()
3023

3124
# Must go below project(..)

‎lldb/tools/debugserver/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
project(Debugserver LANGUAGES C CXX ASM-ATT)
44

@@ -7,13 +7,6 @@ include(GNUInstallDirs)
77

88
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
99
set(LLDB_BUILT_STANDALONE TRUE)
10-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
11-
message(WARNING
12-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
13-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
14-
"using an older CMake will become an error. Please upgrade your CMake to "
15-
"at least 3.20.0 now to avoid issues in the future!")
16-
endif()
1710

1811
set(CMAKE_MODULE_PATH
1912
${CMAKE_MODULE_PATH}

‎llvm-libgcc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libunwind")
44
message(FATAL_ERROR "llvm-libgcc requires being built in a monorepo layout with libunwind available")

‎llvm/CMakeLists.txt

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

3-
cmake_minimum_required(VERSION 3.13.4)
4-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
5-
message(WARNING
6-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
7-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
8-
"using an older CMake will become an error. Please upgrade your CMake to "
9-
"at least 3.20.0 now to avoid issues in the future!")
10-
endif()
3+
cmake_minimum_required(VERSION 3.20.0)
114

125
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
136
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake

‎llvm/docs/CMake.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Quick start
3434
We use here the command-line, non-interactive CMake interface.
3535

3636
#. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
37-
CMake. Version 3.13.4 is the minimum required.
37+
CMake. Version 3.20.0 is the minimum required.
3838

3939
#. Open a shell. Your development tools must be reachable from this shell
4040
through the PATH environment variable.
@@ -911,7 +911,7 @@ and uses them to build a simple application ``simple-tool``.
911911

912912
.. code-block:: cmake
913913
914-
cmake_minimum_required(VERSION 3.13.4)
914+
cmake_minimum_required(VERSION 3.20.0)
915915
project(SimpleProject)
916916
917917
find_package(LLVM REQUIRED CONFIG)

‎llvm/docs/GettingStarted.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ uses the package and provides other details.
280280
=========================================================== ============ ==========================================
281281
Package Version Notes
282282
=========================================================== ============ ==========================================
283-
`CMake <http://cmake.org/>`__ >=3.13.4 Makefile/workspace generator
283+
`CMake <http://cmake.org/>`__ >=3.20.0 Makefile/workspace generator
284284
`GCC <http://gcc.gnu.org/>`_ >=7.1.0 C/C++ compiler\ :sup:`1`
285285
`python <http://www.python.org/>`_ >=3.6 Automated test suite\ :sup:`2`
286286
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`

‎llvm/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ Non-comprehensive list of changes in this release
4747
Update on required toolchains to build LLVM
4848
-------------------------------------------
4949

50+
With LLVM 17.x we raised the version requirement of CMake used to build LLVM.
51+
The new requirements are as follows:
52+
53+
* CMake >= 3.20.0
54+
5055
Changes to the LLVM IR
5156
----------------------
5257

‎mlir/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# MLIR project.
2-
cmake_minimum_required(VERSION 3.13.4)
2+
cmake_minimum_required(VERSION 3.20.0)
33

44
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
55
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -11,13 +11,6 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
1111
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1212
project(mlir)
1313
set(MLIR_STANDALONE_BUILD TRUE)
14-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
15-
message(WARNING
16-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
17-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
18-
"using an older CMake will become an error. Please upgrade your CMake to "
19-
"at least 3.20.0 now to avoid issues in the future!")
20-
endif()
2114
endif()
2215

2316
# Must go below project(..)

‎mlir/examples/standalone/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22
project(standalone-dialect LANGUAGES CXX C)
33

44
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)

‎openmp/CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22

33
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
44

@@ -11,14 +11,7 @@ list(INSERT CMAKE_MODULE_PATH 0
1111
# llvm/runtimes/ will set OPENMP_STANDALONE_BUILD.
1212
if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
1313
set(OPENMP_STANDALONE_BUILD TRUE)
14-
project(openmp C CXX)
15-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
16-
message(WARNING
17-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
18-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
19-
"using an older CMake will become an error. Please upgrade your CMake to "
20-
"at least 3.20.0 now to avoid issues in the future!")
21-
endif()
14+
project(openmp C CXX ASM)
2215
endif()
2316

2417
# Must go below project(..)

‎openmp/cmake/DetectTestCompiler/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.4)
1+
cmake_minimum_required(VERSION 3.20.0)
22
project(DetectTestCompiler C CXX)
33

44
include(CheckCCompilerFlag)

‎openmp/docs/SupportAndFAQ.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ require a few additions.
307307

308308
.. code-block:: cmake
309309
310-
cmake_minimum_required(VERSION 3.13.4)
310+
cmake_minimum_required(VERSION 3.20.0)
311311
project(offloadTest VERSION 1.0 LANGUAGES CXX)
312312
313313
list(APPEND CMAKE_MODULE_PATH "${PATH_TO_OPENMP_INSTALL}/lib/cmake/openmp")
@@ -318,7 +318,7 @@ require a few additions.
318318
target_link_libraries(offload PRIVATE OpenMPTarget::OpenMPTarget_NVPTX)
319319
target_sources(offload PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/Main.cpp)
320320
321-
Using this module requires at least CMake version 3.13.4. Supported languages
321+
Using this module requires at least CMake version 3.20.0. Supported languages
322322
are C and C++ with Fortran support planned in the future. Compiler support is
323323
best for Clang but this module should work for other compiler vendors such as
324324
IBM, GNU.

‎openmp/libompd/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010

1111
project (libompd)
12-
cmake_minimum_required(VERSION 3.13.4)
12+
cmake_minimum_required(VERSION 3.20.0)
1313

1414
add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)
1515

‎openmp/libomptarget/plugins/remote/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
##===----------------------------------------------------------------------===##
1212

13-
cmake_minimum_required(VERSION 3.13.4)
13+
cmake_minimum_required(VERSION 3.20.0)
1414

1515
# Define the suffix for the runtime messaging dumps.
1616
add_definitions(-DTARGET_NAME=RPC)

‎openmp/runtime/src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ libomp_get_asmflags(LIBOMP_CONFIGURED_ASMFLAGS)
133133
# Set the compiler flags for each type of source
134134
set_source_files_properties(${LIBOMP_CXXFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CXXFLAGS}")
135135
set_source_files_properties(${LIBOMP_ASMFILES} ${LIBOMP_GNUASMFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_ASMFLAGS}")
136-
# Let the compiler handle the GNU assembly files
137-
set_source_files_properties(${LIBOMP_GNUASMFILES} PROPERTIES LANGUAGE C)
138136

139137
# Remove any cmake-automatic linking of the standard C++ library.
140138
# We neither need (nor want) the standard C++ library dependency even though we compile c++ files.

‎openmp/tools/Modules/FindOpenMPTarget.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ be used to override the standard flag searching for a given compiler.
7979
# TODO: Test more compilers
8080

8181
cmake_policy(PUSH)
82-
cmake_policy(VERSION 3.13.4)
82+
cmake_policy(VERSION 3.20.0)
8383

8484
find_package(OpenMP ${OpenMPTarget_FIND_VERSION} REQUIRED)
8585

‎openmp/tools/Modules/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require a few additions.
2626

2727
.. code-block:: cmake
2828
29-
cmake_minimum_required(VERSION 3.13.4)
29+
cmake_minimum_required(VERSION 3.20.0)
3030
project(offloadTest VERSION 1.0 LANGUAGES CXX)
3131
3232
list(APPEND CMAKE_MODULE_PATH "${PATH_TO_OPENMP_INSTALL}/lib/cmake/openmp")
@@ -37,7 +37,7 @@ require a few additions.
3737
target_link_libraries(offload PRIVATE OpenMPTarget::OpenMPTarget_NVPTX)
3838
target_sources(offload PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/Main.cpp)
3939
40-
Using this module requires at least CMake version 3.13.4. Supported languages
40+
Using this module requires at least CMake version 3.20.0. Supported languages
4141
are C and C++ with Fortran support planned in the future. If your application
4242
requires building for a specific device architecture you can set the
4343
``OpenMPTarget_<device>_ARCH=<flag>`` variable. Compiler support is best for

‎polly/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
# Check if this is a in tree build.
22
if (NOT DEFINED LLVM_MAIN_SRC_DIR)
33
project(Polly)
4-
cmake_minimum_required(VERSION 3.13.4)
5-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
6-
message(WARNING
7-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
8-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
9-
"using an older CMake will become an error. Please upgrade your CMake to "
10-
"at least 3.20.0 now to avoid issues in the future!")
11-
endif()
4+
cmake_minimum_required(VERSION 3.20.0)
125
set(POLLY_STANDALONE_BUILD TRUE)
136
endif()
147

‎pstl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
#
77
#===----------------------------------------------------------------------===##
8-
cmake_minimum_required(VERSION 3.13.4)
8+
cmake_minimum_required(VERSION 3.20.0)
99

1010
set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
1111
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")

‎runtimes/CMakeLists.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
# This file handles building LLVM runtime sub-projects.
2-
cmake_minimum_required(VERSION 3.13.4)
3-
if ("${CMAKE_VERSION}" VERSION_LESS "3.20.0")
4-
message(WARNING
5-
"Your CMake version is ${CMAKE_VERSION}. Starting with LLVM 17.0.0, the "
6-
"minimum version of CMake required to build LLVM will become 3.20.0, and "
7-
"using an older CMake will become an error. Please upgrade your CMake to "
8-
"at least 3.20.0 now to avoid issues in the future!")
9-
endif()
10-
project(Runtimes C CXX ASM)
2+
cmake_minimum_required(VERSION 3.20.0)
113

124
# Add path for custom and the LLVM build's modules to the CMake module path.
135
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
6+
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
7+
NO_POLICY_SCOPE)
8+
9+
project(Runtimes C CXX ASM)
10+
1411
list(INSERT CMAKE_MODULE_PATH 0
1512
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
1613
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"

0 commit comments

Comments
 (0)
Please sign in to comment.