aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2021-12-25 15:38:54 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-12-25 14:39:17 +0000
commit247e6ed4ceb548eb9df55723fab1f3b535f1d6ac (patch)
treee9867eb1072c3f0eca25766f8d810f198715e523
parent99d365185dbf252a52864a18514ba88d0e2cce75 (diff)
downloadPROJ-247e6ed4ceb548eb9df55723fab1f3b535f1d6ac.tar.gz
PROJ-247e6ed4ceb548eb9df55723fab1f3b535f1d6ac.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 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}"