Skip to content

build(cmake): require C language in googletest and googlemock CMakeLists.txt - #5115

Open
hardiekk wants to merge 1 commit into
google:mainfrom
hardiekk:patch-3
Open

hardiekk wants to merge 1 commit into
google:mainfrom
hardiekk:patch-3

Conversation

@hardiekk

@hardiekk hardiekk commented Oct 4, 2026

Copy link
Copy Markdown

Summary

This PR updates the CMake configurations for both googletest and googlemock to explicitly require the C language.

Motivation

In certain build environments and toolchains, CMake relies on the C compiler to perform internal system checks (such as checking for threading libraries or linking C-based dependencies). By default, if only CXX (C++) is enabled, these checks can fail unexpectedly. This change ensures that the C language is properly initialized during the CMake configuration phase, preventing build failures.

Changes Made

  • Updated googletest/CMakeLists.txt to require the C language.
  • Updated googlemock/CMakeLists.txt to require the C language.

Testing

  • Verified that CMake configures successfully (cmake ..).
  • Confirmed the build succeeds across standard platforms without breaking existing C++ configurations.

This branch has not been deployed

No deployments
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