GCC & CMake versions pre-installed on OSX

I use GCC to build a dependency and when GCC is present on the OSX images, the Homebrew update and install steps can be removed, reducing job execution times.
But there is no documentation on which version is available on each image.

What I have found so far: (test set)

  • xcode11:
    GCC 9.1.0: gcc-9; g++-9
    CMake 3.15.1
  • xcode10.3:
    GCC 9.1.0: gcc-9; g++-9
    CMake 3.15.0
  • xcode10.2:
    GCC 8.3.0: gcc-8; g++-8
    CMake 3.14.2
  • xcode10.1:
    GCC 8.2.0: gcc-8; g++-8; use the command: brew link gcc@8 to make GCC callable.
    CMake 3.12.3
  • xcode10: …
    CMake 3.12.2
  • xcode9.4: …
    CMake 3.11.4
  • xcode9.3: …
    CMake 3.10.2
  • xcode9.2: …
    CMake 3.10.0
  • xcode9.1: …
    CMake 3.9.5
  • xcode9: …
    CMake 3.9.2
  • xcode8.3: …
    CMake 3.9.4
  • xcode8:
    GCC 4.9.3: gcc-4.9; g++-4.9
    CMake 3.6.1
  • xcode7.3:
    GCC 4.9.3: gcc-4.9; g++-4.9
    CMake 3.6.2
  • xcode6.4:
    GCC 4.9.2: gcc-4.9; g++-4.9
    CMake 3.2.2

Does anyone have any additional information, or tips?

On the xcode10.1 (and later) GCC is installed as the latest release available on Homebrew. To ensure the GCC version is not changed with brew upgrade, I relink the installs from gcc to gcc@<version>:

- |
  # OSX: set Homebrew gcc to gcc@<version>, to prevent version upgrades
  if [[ "${TRAVIS_OSX_IMAGE:-}" && ${TRAVIS_OSX_IMAGE} =~ ^xcode(11|10\.[12])$ ]]; then
    brew unlink gcc
    if [[ ${TRAVIS_OSX_IMAGE} == "xcode11" ]]; then 
      brew link gcc@9
      brew link gcc@8

This also covers the issue with xcode10.1 where GCC is not callable with g++-8.


  • xcode11.2:
    GCC 9.2.0: gcc-9; g++-9 (homebrew GCC 9.2.0_1)
    CMake 3.15.4
  • xcode11.1:
    GCC 9.2.0: gcc-9; g++-9
    CMake 3.15.3


  • xcode11:
    GCC 9.2.0: gcc-9; g++-9
    CMake 3.15.3
  • xcode10.1:
    GCC is now callable with gcc-8 and g++-8 by default.

test set

You can check preinstalled version with brew list --versions and run brew update && brew upgrade <package> if it’s lower than you want – or just fail the build to signal to yourself that you need to migrate to a newer image.

1 Like