Skip to content

Commit e78835c

Browse files
committed
Fix compile requirements
set cmake min. version requirement to 3.15 set googletest cxx compile standard to 14 : https://github.com/google/googletest/releases/tag/v1.14.0
1 parent bee0ad5 commit e78835c

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

googlemock/CMakeLists.txt.install

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project(gmock CXX C)
2-
cmake_minimum_required(VERSION 3.8)
2+
cmake_minimum_required(VERSION 3.15)
33

44
find_package(gtest_vendor REQUIRED)
55

@@ -13,7 +13,7 @@ include_directories(
1313
add_library(gmock STATIC
1414
${gtest_vendor_BASE_DIR}/src/gtest-all.cc
1515
src/gmock-all.cc)
16-
target_compile_features(gmock PUBLIC cxx_std_11) # Require C++11
16+
target_compile_features(gmock PUBLIC cxx_std_14) # Require C++14
1717

1818
# When building with asan (i.e. using colcon build --mixin asan-gcc),
1919
# asan itself provides a "fake" pthread that tricks the pthread
@@ -31,4 +31,4 @@ if(NOT WIN32)
3131
endif()
3232

3333
add_library(gmock_main STATIC src/gmock_main.cc)
34-
target_compile_features(gmock_main PUBLIC cxx_std_11) # Require C++11
34+
target_compile_features(gmock_main PUBLIC cxx_std_14) # Require C++14

googlemock/CMakeLists.txt.upstream

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ endif()
3636
# as ${gmock_SOURCE_DIR} and to the root binary directory as
3737
# ${gmock_BINARY_DIR}.
3838
# Language "C" is required for find_package(Threads).
39-
if (CMAKE_VERSION VERSION_LESS 3.0)
40-
project(gmock CXX C)
41-
else()
42-
cmake_policy(SET CMP0048 NEW)
43-
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
44-
endif()
45-
cmake_minimum_required(VERSION 2.8.12)
39+
40+
cmake_policy(SET CMP0048 NEW)
41+
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
42+
43+
cmake_minimum_required(VERSION 3.15)
4644

4745
if (COMMAND set_up_hermetic_build)
4846
set_up_hermetic_build()

googletest/CMakeLists.txt.install

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
project(gtest CXX C)
2-
cmake_minimum_required(VERSION 3.8)
2+
cmake_minimum_required(VERSION 3.15)
33

44
include_directories(
55
include
66
. # to find the source files included with "src/gtest*.cc"
77
)
88

99
add_library(gtest STATIC src/gtest-all.cc)
10-
target_compile_features(gtest PUBLIC cxx_std_11) # Require C++11
10+
target_compile_features(gtest PUBLIC cxx_std_14) # Require C++14
1111

1212
# When building with asan (i.e. using colcon build --mixin asan-gcc),
1313
# asan itself provides a "fake" pthread that tricks the pthread
@@ -25,4 +25,4 @@ if(NOT WIN32)
2525
endif()
2626

2727
add_library(gtest_main STATIC src/gtest_main.cc)
28-
target_compile_features(gtest_main PUBLIC cxx_std_11) # Require C++11
28+
target_compile_features(gtest_main PUBLIC cxx_std_14) # Require C++14

googletest/CMakeLists.txt.upstream

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,10 @@ endif()
4646

4747
# Project version:
4848

49-
if (CMAKE_VERSION VERSION_LESS 3.0)
50-
project(gtest CXX C)
51-
set(PROJECT_VERSION ${GOOGLETEST_VERSION})
52-
else()
53-
cmake_policy(SET CMP0048 NEW)
54-
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
55-
endif()
56-
cmake_minimum_required(VERSION 2.8.12)
49+
cmake_policy(SET CMP0048 NEW)
50+
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
51+
52+
cmake_minimum_required(VERSION 3.15)
5753

5854
if (POLICY CMP0063) # Visibility
5955
cmake_policy(SET CMP0063 NEW)

0 commit comments

Comments
 (0)