Skip to content

Commit f5c7b8c

Browse files
committed
Fix macos_98 build problem to make GoogleTest 1.8.1 work with modern CMake
1 parent 74c0bcb commit f5c7b8c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.build/install-gtest

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ if [ "$gtest_version_tag" = release-1.8.1 ]; then
7171
fi
7272
mkdir build
7373
cd build
74-
# Configure - build only GoogleTest, not GoogleMock
75-
cmake .. -DBUILD_GMOCK=OFF
74+
# Configure - build only GoogleTest, not GoogleMock.
75+
# CMAKE_POLICY_VERSION_MINIMUM is a workaround for GoogleTest v1.8.1 (which sets `cmake_minimum_required` to `2.8.8`)
76+
# to make it work with CMake 4.0+, which removed compatibility with CMake < 3.5.
77+
cmake .. -DBUILD_GMOCK=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5
7678
# Build
7779
make
7880
# Install

0 commit comments

Comments
 (0)