# Supported Platforms and Compilers for GoogleTest: Complete Compatibility Guide

> Discover supported platforms and compilers for GoogleTest. Ensure compatibility with Linux macOS Windows Android iOS Chrome OS Fuchsia and GCC Clang MSVC Apple Clang.

- Repository: [Google/googletest](https://github.com/google/googletest)
- Tags: compatibility-guide
- Published: 2026-09-01

---

**GoogleTest supports Linux, macOS, Windows, Android, iOS, Chrome OS, and Fuchsia through GCC 7.5+, Clang 6.0+, MSVC 2017+, and Apple Clang 9.0+, following Google's Foundational C++ Support Policy.**

The `google/googletest` repository maintains strict compatibility standards defined by the [Foundational C++ Support Matrix](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md), ensuring reliable test execution across diverse operating systems and toolchain versions. This article details the officially supported platforms, minimum compiler requirements, and build configurations validated against the current source tree.

## Officially Supported Platforms

GoogleTest validates its codebase against seven primary platform families. Each target uses specific compiler families and minimum versions as documented in [`docs/platforms.md`](https://github.com/google/googletest/blob/main/docs/platforms.md).

### Linux

Linux distributions support **GCC 7.5+** and **Clang 6.0+** as primary compilers. The implementation in `googletest/src/gtest.cc` contains platform-specific workarounds that activate automatically based on compiler detection macros.

### macOS

Apple platforms require **Apple Clang 9.0+** (bundled with Xcode 9+). The header [`googletest/include/gtest/gtest.h`](https://github.com/google/googletest/blob/main/googletest/include/gtest/gtest.h) uses preprocessor directives to adapt to the Darwin toolchain environment.

### Windows

Windows builds primarily target **MSVC 2017 (v15.7)+**. Alternative support exists for **Clang-CL (Clang 10+)** through the same CMake build definitions in [`googletest/CMakeLists.txt`](https://github.com/google/googletest/blob/main/googletest/CMakeLists.txt) that configure compiler-specific flags.

### Android and iOS

Mobile platforms use cross-compilation toolchains:

- **Android**: Requires **NDK Clang r18+** targeting API 21+. The build system links against static libraries compiled via the NDK LLVM toolchain.
- **iOS**: Uses **Apple Clang 9.0+** (Xcode 9+) targeting simulators and physical devices.

### Chrome OS and Fuchsia

- **Chrome OS**: Leverages host Linux GCC/Clang versions matching the development environment.
- **Fuchsia**: Requires **Clang 12+** via the Fuchsia SDK, with specific sysroot configurations handled in the build files.

## Compiler Requirements and Minimum Versions

The following matrix summarizes the baseline compiler versions required to build GoogleTest from source:

| Platform | Compiler Family | Minimum Version |
|----------|----------------|-----------------|
| Linux | GCC | 7.5 |
| Linux | Clang | 6.0 |
| macOS | Apple Clang | 9.0 (Xcode 9) |
| Windows | MSVC | 2017 (v15.7) |
| Windows | Clang-CL | 10.0 |
| Android | NDK Clang | r18 |
| Fuchsia | Clang | 12.0 |

GoogleTest requires **C++11 as a baseline standard**. When the compiler supports newer language features (C++14, C++17, C++20), GoogleTest enables additional optimizations and features automatically. If the compiler lacks full C++11 support, the library falls back to compatibility mode that disables newer language constructs.

## Build System Support

The project officially supports **CMake 3.10+** and **Bazel**. The [`googletest/CMakeLists.txt`](https://github.com/google/googletest/blob/main/googletest/CMakeLists.txt) file defines compiler detection logic that sets appropriate warning flags and standard library linking for each supported toolchain across libstdc++, libc++, and MSVC STL implementations.

## Cross-Platform Compilation Examples

### Linux with GCC

Create a basic test file and compile with pthread support:

```cpp
// example_test.cpp
#include <gtest/gtest.h>

TEST(Math, Add) {
  EXPECT_EQ(2 + 2, 4);
}

```

```bash
g++ -std=c++14 -pthread example_test.cpp -lgtest -lgtest_main -o example_test
./example_test

```

### Windows with MSVC

Using the Visual Studio Developer Command Prompt:

```batch
cl /EHsc /std:c++14 example_test.cpp /I %GTEST_ROOT%\include ^
   %GTEST_ROOT%\lib\gtest.lib %GTEST_ROOT%\lib\gtest_main.lib
example_test.exe

```

### Android NDK Cross-Compilation

Target ARMv7 devices using the NDK toolchain:

```bash
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ \
  --target=armv7-none-linux-androideabi21 \
  -std=c++14 -isystem $GTEST_ROOT/include \
  example_test.cpp $GTEST_ROOT/lib/libgtest.a $GTEST_ROOT/lib/libgtest_main.a \
  -o example_test_arm

adb push example_test_arm /data/local/tmp/
adb shell /data/local/tmp/example_test_arm

```

## Key Implementation Files

Understanding the platform abstraction layer requires examining these specific source locations:

- [`googletest/include/gtest/gtest.h`](https://github.com/google/googletest/blob/main/googletest/include/gtest/gtest.h): Public API header containing platform-detection macros
- [`googletest/CMakeLists.txt`](https://github.com/google/googletest/blob/main/googletest/CMakeLists.txt): Build definitions specifying compiler flags for supported toolchains  
- `googletest/src/gtest.cc`: Core implementation with compiler-specific workarounds
- [`docs/platforms.md`](https://github.com/google/googletest/blob/main/docs/platforms.md): Official platform support documentation linking to the Foundational C++ Support Matrix

## Summary

- GoogleTest supports Linux, macOS, Windows, Android, iOS, Chrome OS, and Fuchsia through the `google/googletest` repository.
- Minimum compiler versions include GCC 7.5+, Clang 6.0+, Apple Clang 9.0+, MSVC 2017+, and NDK Clang r18+.
- The library requires C++11 minimum but automatically enables C++14/17/20 features when available.
- Build systems CMake 3.10+ and Bazel are officially supported with configurations in [`googletest/CMakeLists.txt`](https://github.com/google/googletest/blob/main/googletest/CMakeLists.txt).
- Platform-specific logic is centralized in `googletest/src/gtest.cc` and activated through preprocessor detection.

## Frequently Asked Questions

### What is the minimum C++ standard required for GoogleTest?

GoogleTest requires **C++11** as the baseline standard. The source code in [`googletest/include/gtest/gtest.h`](https://github.com/google/googletest/blob/main/googletest/include/gtest/gtest.h) uses feature detection macros to enable C++14, C++17, or C++20 optimizations when the compiler supports them. If the compiler lacks complete C++11 support, GoogleTest falls back to compatibility mode that disables newer language features.

### Can I use GoogleTest with compilers not listed in the support matrix?

While GoogleTest is designed to work on any environment complying with Google's Foundational C++ Support Policy, only the specific compiler versions listed in the [Foundational C++ Support Matrix](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) receive continuous integration testing. Compilers outside this matrix may function but are not officially supported.

### How do I build GoogleTest for Android using the NDK?

Cross-compile using NDK Clang r18+ with API level 21 or higher. The toolchain located at `$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++` requires explicit `--target` flags specifying the Android ABI. Link against static GoogleTest libraries (`libgtest.a` and `libgtest_main.a`) rather than shared libraries to avoid runtime dependencies on the target device.

### Is GoogleTest compatible with Clang-CL on Windows?

Yes. GoogleTest officially supports **Clang-CL 10+** on Windows as an alternative to MSVC. The [`googletest/CMakeLists.txt`](https://github.com/google/googletest/blob/main/googletest/CMakeLists.txt) build definitions automatically detect Clang-CL front-ends and adjust compiler flags accordingly, allowing the same test code to compile with either MSVC or Clang-CL toolchains.