From 2d9e02b0a7912527c4e12a0904afd3993e3ee49b Mon Sep 17 00:00:00 2001 From: AnnieL Date: Tue, 20 Dec 2016 23:47:08 +0000 Subject: [PATCH] Check if gcc version is below 5.1 or equal to 6.1 Outputs a fatal_error if a version of gcc below 5.1 or 6.1 is being used. #2236 --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f06f9f46a..a791b8c0c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,14 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." ) endif() +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) + message( FATAL_ERROR "RPCS3 requires at least gcc-5.1." ) +endif() + +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.1) + message( FATAL_ERROR "RPCS3 can't be compiled with gcc-6.1, see #1691." ) +endif() + add_definitions(-DCMAKE_BUILD) # We use libpng's static library and don't need to build the shared library and run the tests