Skip to content

Commit

Permalink
[CMake] Bump CMake minimum version to 3.13.4
Browse files Browse the repository at this point in the history
This upgrade should be friction-less because we've already been ensuring
that CMake >= 3.13.4 is used.

This is part of the effort discussed on llvm-dev here:

  http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html

Differential Revision: https://reviews.llvm.org/D78648
  • Loading branch information
ldionne committed Jul 22, 2020
1 parent 3eec657 commit afa1afd
Show file tree
Hide file tree
Showing 28 changed files with 38 additions and 47 deletions.
2 changes: 1 addition & 1 deletion clang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(exec C)

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

include(CheckCCompilerFlag)
check_c_compiler_flag("-std=c99" C99_SUPPORTED)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# An important constraint of the build is that it only produces libraries
# based on the ability of the host toolchain to target various platforms.

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)
project(custom-libcxx C CXX)

# Build static libcxxabi.
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# architecture-specific code in various subdirectories.

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

project(CompilerRTBuiltins C ASM)
set(COMPILER_RT_STANDALONE_BUILD TRUE)
Expand Down
2 changes: 1 addition & 1 deletion flang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9.0)
cmake_minimum_required(VERSION 3.13.4)

# RPATH settings on macOS do not affect INSTALL_NAME.
if (POLICY CMP0068)
Expand Down
2 changes: 1 addition & 1 deletion libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required( VERSION 3.9.2 )
cmake_minimum_required(VERSION 3.13.4)

project( libclc VERSION 0.2.0 LANGUAGES CXX )
include( GNUInstallDirs )
Expand Down
2 changes: 1 addition & 1 deletion libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()
#===============================================================================
# Setup Project
#===============================================================================
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
Expand Down
2 changes: 1 addition & 1 deletion libcxx/utils/ci/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
Expand Down
2 changes: 1 addition & 1 deletion libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()
# Setup Project
#===============================================================================

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
Expand Down
2 changes: 1 addition & 1 deletion libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Setup Project
#===============================================================================

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
Expand Down
2 changes: 1 addition & 1 deletion lld/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Check if lld is built as a standalone project.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(lld)
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(LLD_BUILT_STANDALONE TRUE)
Expand Down
5 changes: 1 addition & 4 deletions lldb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
cmake_minimum_required(VERSION 3.4.3)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
cmake_minimum_required(VERSION 3.13)
endif()
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
Expand Down
2 changes: 1 addition & 1 deletion lldb/tools/debugserver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

project(Debugserver LANGUAGES C CXX ASM-ATT)

Expand Down
8 changes: 1 addition & 7 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# See docs/CMake.html for instructions about how to build LLVM with CMake.

cmake_minimum_required(VERSION 3.4.3)

if ("${CMAKE_VERSION}" VERSION_LESS "3.13.4")
message(FATAL_ERROR
"Your CMake version is ${CMAKE_VERSION}. The minimum version of CMake "
"required to build LLVM is now 3.13.4.")
endif()
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
Expand Down
4 changes: 2 additions & 2 deletions llvm/docs/CMake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Quick start
We use here the command-line, non-interactive CMake interface.

#. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
CMake. Version 3.4.3 is the minimum required.
CMake. Version 3.13.4 is the minimum required.

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

.. code-block:: cmake
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)
project(SimpleProject)
find_package(LLVM REQUIRED CONFIG)
Expand Down
18 changes: 9 additions & 9 deletions llvm/docs/CMakePrimer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ program. The example uses only CMake language-defined functions.

.. code-block:: cmake
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.15)
project(HelloWorld)
add_executable(HelloWorld HelloWorld.cpp)
Expand All @@ -64,13 +64,13 @@ block to define "APPLE" when targeting Apple platforms:

.. code-block:: cmake
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.15)
project(HelloWorld)
add_executable(HelloWorld HelloWorld.cpp)
if(APPLE)
target_compile_definitions(HelloWorld PUBLIC APPLE)
endif()
Variables, Types, and Scope
===========================

Expand All @@ -93,7 +93,7 @@ example:
set(var_name var1)
set(${var_name} foo) # same as "set(var1 foo)"
set(${${var_name}}_var bar) # same as "set(foo_var bar)"
Dereferencing an unset variable results in an empty expansion. It is a common
pattern in CMake to conditionally set variables knowing that it will be used in
code paths that the variable isn't set. There are examples of this throughout
Expand All @@ -107,7 +107,7 @@ An example of variable empty expansion is:
set(extra_sources Apple.cpp)
endif()
add_executable(HelloWorld HelloWorld.cpp ${extra_sources})
In this example the ``extra_sources`` variable is only defined if you're
targeting an Apple platform. For all other targets the ``extra_sources`` will be
evaluated as empty before add_executable is given its arguments.
Expand All @@ -124,7 +124,7 @@ defining lists:
# Creates a list with members a, b, c, and d
set(my_list a b c d)
set(my_list "a;b;c;d")
# Creates a string "a b c d"
set(my_string "a b c d")
Expand All @@ -141,7 +141,7 @@ make a list of variable names that refer to other lists. For example:
set(a 1 2 3)
set(b 4 5 6)
set(c 7 8 9)
With this layout you can iterate through the list of lists printing each value
with the following code:

Expand All @@ -152,7 +152,7 @@ with the following code:
message(${value})
endforeach()
endforeach()
You'll notice that the inner foreach loop's list is doubly dereferenced. This is
because the first dereference turns ``list_name`` into the name of the sub-list
(a, b, or c in the example), then the second dereference is to get the value of
Expand Down Expand Up @@ -385,7 +385,7 @@ result in some unexpected behavior if using unreferenced variables. For example:
message("${var}")
endforeach()
endmacro()
set(my_list a b c d)
set(my_list_of_numbers 1 2 3 4)
print_list(my_list_of_numbers)
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ uses the package and provides other details.
=========================================================== ============ ==========================================
Package Version Notes
=========================================================== ============ ==========================================
`CMake <http://cmake.org/>`__ >=3.4.3 Makefile/workspace generator
`CMake <http://cmake.org/>`__ >=3.13.4 Makefile/workspace generator
`GCC <http://gcc.gnu.org/>`_ >=5.1.0 C/C++ compiler\ :sup:`1`
`python <http://www.python.org/>`_ >=2.7 Automated test suite\ :sup:`2`
`zlib <http://zlib.net>`_ >=1.2.3.4 Compression library\ :sup:`3`
Expand Down
4 changes: 2 additions & 2 deletions llvm/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Setting CMake minimum required version should be at the very top of the file
# if this is the entry point.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)
project(Runtimes C CXX ASM)
endif()

Expand Down Expand Up @@ -56,7 +56,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
set_property(GLOBAL APPEND PROPERTY SUB_COMPONENTS ${name})
endfunction()

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)
project(Runtimes C CXX ASM)

find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required(VERSION 3.13.4)

# Tell cmake 3.0+ that it's safe to clear the PROJECT_VERSION variable in the
# call to project() below.
Expand Down
2 changes: 1 addition & 1 deletion mlir/examples/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.13.4)

if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
Expand Down
2 changes: 1 addition & 1 deletion openmp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13.4)

# Add cmake directory to search for custom cmake functions.
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
Expand Down
2 changes: 1 addition & 1 deletion openmp/cmake/DetectTestCompiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.13.4)
project(DetectTestCompiler C CXX)

include(CheckCCompilerFlag)
Expand Down
2 changes: 1 addition & 1 deletion openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(libomp_check_linker_flag flag boolean)
set(library_source
"int foo(int a) { return a*a; }")
set(cmake_source
"cmake_minimum_required(VERSION 2.8)
"cmake_minimum_required(VERSION 3.13.4)
project(foo C)
set(CMAKE_SHARED_LINKER_FLAGS \"${flag}\")
add_library(foo SHARED src_to_link.c)")
Expand Down
2 changes: 1 addition & 1 deletion parallel-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.13.4)
2 changes: 1 addition & 1 deletion parallel-libs/acxxel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.13.4)

option(ACXXEL_ENABLE_UNIT_TESTS "enable acxxel unit tests" ON)
option(ACXXEL_ENABLE_MULTI_DEVICE_UNIT_TESTS "enable acxxel multi-device unit tests" OFF)
Expand Down
2 changes: 1 addition & 1 deletion polly/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Check if this is a in tree build.
if (NOT DEFINED LLVM_MAIN_SRC_DIR)
project(Polly)
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

# Where is LLVM installed?
find_package(LLVM CONFIG REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion pstl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------------------------------------------===##
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.13.4)

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

0 comments on commit afa1afd

Please sign in to comment.