Skip to content

Commit fb6fde8

Browse files
authored
[BUILD] Upgrade cmake (open-telemetry#3167)
1 parent d15da3b commit fb6fde8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

CMakeLists.txt

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.9)
4+
cmake_minimum_required(VERSION 3.10)
55

6-
# See https://cmake.org/cmake/help/v3.3/policy/CMP0057.html required by certain
7-
# versions of gtest
8-
cmake_policy(SET CMP0057 NEW)
9-
10-
# See https://cmake.org/cmake/help/v3.12/policy/CMP0074.html required by certain
11-
# version of zlib which CURL depends on.
6+
# See https://cmake.org/cmake/help/latest/policy/CMP0074.html required by
7+
# certain version of zlib which CURL depends on.
128
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
139
cmake_policy(SET CMP0074 NEW)
1410
endif()
1511

12+
# Allow to use normal variable for option()
13+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
14+
cmake_policy(SET CMP0077 NEW)
15+
endif()
16+
1617
# Prefer CMAKE_MSVC_RUNTIME_LIBRARY if possible
1718
if(POLICY CMP0091)
1819
cmake_policy(SET CMP0091 NEW)
1920
endif()
2021

22+
# MSVC RTTI flag /GR should not be not added to CMAKE_CXX_FLAGS by default. @see
23+
# https://cmake.org/cmake/help/latest/policy/CMP0117.html
24+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20.0")
25+
cmake_policy(SET CMP0117 NEW)
26+
endif()
27+
2128
project(opentelemetry-cpp)
2229

2330
# Mark variables as used so cmake doesn't complain about them

0 commit comments

Comments
 (0)