aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2019-04-16 09:38:51 +0000
committerMike Taves <mwtoews@gmail.com>2019-04-16 09:59:52 +0000
commit421653b9c61f253e800ca749e9b1a9ba0688d72a (patch)
treebeb5b144f4d3bded49b025e46d653bbf258e3419 /CMakeLists.txt
parentc16c23addf48fcb3c87e18bcfd4ebcf0d873a30d (diff)
downloadPROJ-421653b9c61f253e800ca749e9b1a9ba0688d72a.tar.gz
PROJ-421653b9c61f253e800ca749e9b1a9ba0688d72a.zip
CMake: better support for Intel compiler
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 8 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68c941c6..12a24b7b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,24 +68,20 @@ elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
/wd4996 # Suppress warning about sprintf, etc., being unsafe
)
set(PROJ_CXX_WARN_FLAGS /EHsc ${PROJ_C_WARN_FLAGS})
+elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
+ if(MSVC)
+ set(PROJ_C_WARN_FLAGS /Wall)
+ set(PROJ_CXX_WARN_FLAGS /Wall)
+ else()
+ set(PROJ_C_WARN_FLAGS -Wall)
+ set(PROJ_CXX_WARN_FLAGS -Wall)
+ endif()
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}"
CACHE STRING "C++ flags used to compile PROJ targets")
-# Tell Intel compiler to do arithmetic accurately. This is needed to
-# stop the compiler from ignoring parentheses in expressions like
-# (a + b) + c and from simplifying 0.0 + x to x (which is wrong if
-# x = -0.0).
-if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
- if(MSVC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
- else()
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise")
- endif()
-endif()
-
################################################################################
# PROJ CMake modules
################################################################################