Skip to content

Commit

Permalink
Rev cmake minimum version from 3.14.2 to 3.14.5 (#34757)
Browse files Browse the repository at this point in the history
iOS requires 3.14.5 version and we have a special case for it. Since this is a minor version difference, and no distro is particularly providing cmake 3.14.2 package, it is safe to update to 3.14.5 to cover our supported platform matrix.

Discussion: #33959 (comment)
Fixes: #33976

Co-authored-by: Alexander Köplinger <[email protected]>
  • Loading branch information
am11 and akoeplinger authored Jun 1, 2020
1 parent 7493302 commit e2541c7
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/workflow/requirements/linux-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs (
Toolchain Setup
---------------

Building the repo requires CMake 3.14.2 or newer on Linux. Add Kitware's APT feed to your configuration for a newer version of CMake. See their instructions at <https://apt.kitware.com/>. You may need to add LLVM's APT feed to your configuration to obtain the required version of clang/LLVM. See their instructions at <https://apt.llvm.org/>.
Building the repo requires CMake 3.14.5 or newer on Linux. Add Kitware's APT feed to your configuration for a newer version of CMake. See their instructions at <https://apt.kitware.com/>. You may need to add LLVM's APT feed to your configuration to obtain the required version of clang/LLVM. See their instructions at <https://apt.llvm.org/>.

Install the following packages for the toolchain:

Expand Down
8 changes: 5 additions & 3 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ check_prereqs()

function version { echo "$@" | awk -F. '{ printf("%d%02d%02d\n", $1,$2,$3); }'; }

local cmake_version="$(cmake --version | awk '/^cmake.* version [0-9]+\.[0-9]+\.[0-9]+$/ {print $3}')"
local cmakeRequiredMinimumVersion="3.14.5"
local cmakeInstalledVersion="$(cmake --version | awk '/^cmake.* version [0-9]+\.[0-9]+\.[0-9]+$/ {print $3}')"

if [[ "$(version "$cmake_version")" -lt "$(version 3.14.2)" ]]; then
echo "Please install CMake 3.14.2 or newer from https://cmake.org/download/ or https://apt.kitware.com and ensure it is on your path."; exit 1;
if [[ "$(version "$cmakeInstalledVersion")" -lt "$(version "$cmakeRequiredMinimumVersion")" ]]; then
echo "Found cmake v$cmakeInstalledVersion in PATH. Please install v$cmakeRequiredMinimumVersion or newer from https://www.cmake.org/download/."
exit 1;
fi

if [[ "$__HostOS" == "OSX" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dotnet": "5.0.100-preview.6.20266.3"
},
"native-tools": {
"cmake": "3.14.2",
"cmake": "3.14.5",
"python3": "3.7.1"
},
"msbuild-sdks": {
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)

cmake_policy(SET CMP0042 NEW)

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/pal/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)

# Compile options
add_definitions(-DLP64COMPATIBLE)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)

cmake_policy(SET CMP0042 NEW)
project(Tests)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tests/src/profiler/native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5.2)
cmake_minimum_required(VERSION 3.14.5)

project(Profiler)

Expand Down
2 changes: 1 addition & 1 deletion src/installer/corehost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)

project(corehost)

Expand Down
2 changes: 1 addition & 1 deletion src/installer/corehost/cli/test/mockhostfxr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.

cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 3.14.5)
project(mockhostfxr_2_2)

set(DOTNET_PROJECT_NAME "mockhostfxr_2_2")
Expand Down
7 changes: 1 addition & 6 deletions src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)
cmake_policy(SET CMP0042 NEW)

project(CoreFX C)

include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

if(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
# CMake 3.14.5 contains bug fixes for iOS
cmake_minimum_required(VERSION 3.14.5)
endif()

if(NOT CLR_CMAKE_TARGET_BROWSER)
cmake_policy(SET CMP0083 NEW)
endif(NOT CLR_CMAKE_TARGET_BROWSER)
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Native/Windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.2)
cmake_minimum_required(VERSION 3.14.5)

# C Compiler flags
SET (CMAKE_C_FLAGS_INIT "/W0 /FC")
Expand Down
2 changes: 1 addition & 1 deletion src/mono/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.14.5)

project (mono)

Expand Down

0 comments on commit e2541c7

Please sign in to comment.