aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2021-12-25 15:38:54 +0100
committerGitHub <noreply@github.com>2021-12-25 15:38:54 +0100
commit08186f8b448f37798207c7835150e817d5c843e1 (patch)
tree7f0b6d6eb9148b22c7f0e92d42f8f7dbfb7275a7
parent0158de0603e9f37fdb58c7dfb932efc958bd5ea9 (diff)
parent146374460ad244e009f23d6fd63aebc7edec3ecb (diff)
downloadPROJ-08186f8b448f37798207c7835150e817d5c843e1.tar.gz
PROJ-08186f8b448f37798207c7835150e817d5c843e1.zip
Merge pull request #2994 from rouault/icx_fix
Fix build with Intel C++ compiler
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 744ee4c2..c1416fa9 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}"