From e2bb4eb87a531be515c46a29135d52b02dc9c348 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 19 Feb 2016 13:27:20 +0100 Subject: [PATCH] don't do -ipo check for non-intel compilers (causes issues with Clang on OSX) --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d4404540..c3e60799c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" endif() # Intel equivalent to LTO is called IPO - CHECK_CXX_COMPILER_FLAG("-ipo" HAS_IPO_FLAG) - if (HAS_IPO_FLAG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ipo") + if (CMAKE_CXX_COMPILER_ID MATCHES "Intel") + CHECK_CXX_COMPILER_FLAG("-ipo" HAS_IPO_FLAG) + if (HAS_IPO_FLAG) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ipo") + endif() endif() endif() endif()