From a405cf29c08dd55d33b589f9767316d5a2642bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Tue, 9 Jun 2020 23:47:25 +0200 Subject: [PATCH] Trying to solve issue on ARM --- cmake/compilerFlags.cmake | 4 ++-- cmake/mainSetup.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/compilerFlags.cmake b/cmake/compilerFlags.cmake index cef5ab4b67..586e0e21d1 100644 --- a/cmake/compilerFlags.cmake +++ b/cmake/compilerFlags.cmake @@ -25,7 +25,7 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN # This fails under Fedora - MinGW - Gcc 8.3 if (NOT MINGW) - if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) + if (COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0") if (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") add_compile_options(-fstack-clash-protection -fcf-protection) else() @@ -33,7 +33,7 @@ if ( MINGW OR UNIX OR MSYS ) # MINGW, Linux, APPLE, CYGWIN endif() endif() - if (COMPILER_IS_GCC OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.7 )) + if (COMPILER_IS_GCC OR (COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.6" )) # is not available for clang 3.4.2. it appears to be present in clang 3.7. add_compile_options(-fstack-protector-strong) endif() diff --git a/cmake/mainSetup.cmake b/cmake/mainSetup.cmake index d8d7c30b93..f411c8e44a 100644 --- a/cmake/mainSetup.cmake +++ b/cmake/mainSetup.cmake @@ -1,6 +1,10 @@ # In this file we configure some CMake settings we do not want to make visible directly in the main # CMakeLists.txt file. +if(POLICY CMP0054) # CMake 3.1: Only interpret if() arguments as variables or keywords when unquoted. + cmake_policy(SET CMP0054 NEW) +endif() + include(GNUInstallDirs) include(CheckFunctionExists) include(GenerateExportHeader)