Skip to content

Stop building gmock, drop a dead FetchContent option - #74

Merged
sbogomolov merged 1 commit into
mainfrom
build/drop-gmock-and-dead-fetchcontent-line
Aug 10, 2026
Merged

Stop building gmock, drop a dead FetchContent option#74
sbogomolov merged 1 commit into
mainfrom
build/drop-gmock-and-dead-fetchcontent-line

Conversation

@sbogomolov

Copy link
Copy Markdown
Owner

Two build-file removals, prompted by asking whether anything in the build existed
to cope with the pre-1.18 googletest. Nothing did — but two lines were doing
nothing useful.

BUILD_GMOCK defaults on, so gmock's translation units were compiled in every
configure and build (native, docker debug/release, valgrind, and the armv7/armv5
cross-builds) and linked by nobody. The suite has zero gmock references: its
tests/mocks are fakes that model behaviour — FakeLinkSocket::Rebind() sets the
socket attached and its groups joined, FakeInterface::Reidentify() implements the
whole identity state machine — so tests assert outcomes rather than call
expectations. Call expectations would pin how a repair happens instead of that it
happened, which is the opposite of how this suite is written.

GIT_SHALLOW FALSE restated CMake's default (the option is opt-in, adding --depth 1),
and its comment credited it with checking out submodules, which it has nothing to do
with — that is GIT_SUBMODULES. It dated from the initial commit, so it was never
working around anything.

Verified by purging the fetched dependency and reconfiguring: googlemock/ no longer
appears in the build tree, where it previously held gmock-all.cc.o and gmock_main.
910 unit tests native (Debug, ASan/UBSan) and 899 in docker, which builds from a fresh
clone and configure.

The suite's fakes model behaviour rather than call expectations, so gmock was
built and linked by nobody. GIT_SHALLOW FALSE restated CMake's default, and
its comment credited it with a submodule checkout it does not do.
@sbogomolov sbogomolov self-assigned this Aug 10, 2026
@sbogomolov
sbogomolov merged commit dfbe216 into main Aug 10, 2026
17 checks passed
@sbogomolov
sbogomolov deleted the build/drop-gmock-and-dead-fetchcontent-line branch August 10, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant