diff options
author | Peter Powell <petpow@saberuk.com> | 2015-07-13 19:26:02 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-07-13 19:26:02 -0400 |
commit | 2a6ad3d9fcf638ab0b3031aaf4c4d9b5b6059386 (patch) | |
tree | 94b8c5f8fe410474ba02804b3581517d2ae4cd38 /CMakeLists.txt | |
parent | 38cbff4156698d0266c4b6069f5b45031656827c (diff) |
Refuse to configure with old compilers that can't build Anope.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d3eca0f57..5552ab0fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,15 @@ set(ENV{LC_ALL} C) set(DEFAULT_LIBRARY_DIRS) set(DEFAULT_INCLUDE_DIRS) +# Check that we aren't running on an ancient broken GCC +if(CMAKE_COMPILER_IS_GNUCXX) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_FULL_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REGEX REPLACE "^(\\d+\\.\\d+)" "\\1" GCC_VERSION ${GCC_FULL_VERSION}) + if(GCC_VERSION LESS 4.2) + message(FATAL_ERROR "Your compiler is too old to build Anope. Upgrade to GCC 4.2 or newer!") + endif(GCC_VERSION LESS 4.2) +endif(CMAKE_COMPILER_IS_GNUCXX) + # If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$") # First look for the compiler's default library directories |