From 2bfb2cfb5a462e306e4cb42da3d6a2e9f53204cb Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Wed, 18 Jun 2014 17:28:28 +0200 Subject: [PATCH 1/1] add rule to use gcc-ar and gcc-ranlib instead of ar and ranlib for gcc >=4.9 see https://gcc.gnu.org/gcc-4.9/changes.html for explanations --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73b8dfdb6f..a97eb9670b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,12 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") if(${GCC_NEED_VERSION} GREATER COMPILER_C_VERSION_MAJOR_MINOR) message(FATAL_ERROR "Gcc must be to version ${GCC_NEED_VERSION} current version ${COMPILER_C_VERSION_MAJOR_MINOR}") endif() + + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8") + set (CMAKE_AR gcc-ar) + set (CMAKE_RANLIB gcc-ranlib) + endif() + endif() exec_program("${CMAKE_LINKER} --version" OUTPUT_VARIABLE "LINKER_VERSION") -- 2.20.1