Skip to content

Commit 54113ef

Browse files
committed
Update gtest used to v1.15.2
1 parent 9b5f4c5 commit 54113ef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmake/modules/GoogleTest.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,20 @@ if(WIN32)
1616
-Dgtest_force_shared_crt=ON
1717
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG>)
1818
elseif(APPLE)
19+
#FIXME: Temporarily remove -pedantic from CMAKE_CXX_FLAGS to avoid issues with building
20+
# latest version of gtest on MacOS (use of -Wc++17-attribute-extensions causes
21+
# issues due to [[maybe_unused]] in gtest)
1922
set(EXTRA_GTEST_OPTS -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT})
23+
set(CMAKE_CXX_FLAGS_TEMP_COPY ${CMAKE_CXX_FLAGS})
24+
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
2025
endif()
2126

2227
include(ExternalProject)
2328
ExternalProject_Add(
2429
googletest
2530
GIT_REPOSITORY https://github.com/google/googletest.git
2631
GIT_SHALLOW 1
27-
GIT_TAG release-1.12.1
32+
GIT_TAG v1.15.2
2833
UPDATE_COMMAND ""
2934
# # Force separate output paths for debug and release builds to allow easy
3035
# # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
@@ -50,6 +55,11 @@ ExternalProject_Add(
5055
TIMEOUT 600
5156
)
5257

58+
#FIXME: Related to fixme above which temporarily remodifies CMAKE_CXX_FLAGS
59+
if(APPLE)
60+
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_TEMP_COPY})
61+
endif()
62+
5363
# Specify include dirs for gtest and gmock
5464
ExternalProject_Get_Property(googletest source_dir)
5565
set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include)

0 commit comments

Comments
 (0)