From 247e6ed4ceb548eb9df55723fab1f3b535f1d6ac Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sat, 25 Dec 2021 15:38:54 +0100 Subject: Merge pull request #2994 from rouault/icx_fix Fix build with Intel C++ compiler --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 661b3f6a..96034608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,13 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel") endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") + # Intel CXX compiler based on clang defaults to -ffast-math, which + # breaks std::isinf(), std::isnan(), etc. + set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -fno-fast-math) + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fno-fast-math) +endif () + set(PROJ_C_WARN_FLAGS "${PROJ_C_WARN_FLAGS}" CACHE STRING "C flags used to compile PROJ targets") set(PROJ_CXX_WARN_FLAGS "${PROJ_CXX_WARN_FLAGS}" -- cgit v1.2.3