Skip to content

Commit

Permalink
#1173: CI: avoid unsupported flags when compiling with icc
Browse files Browse the repository at this point in the history
Avoid unsupported flags and silence remarks for libfort when compiling
with icc.
  • Loading branch information
cz4rs committed Feb 1, 2021
1 parent f7ce521 commit 033a6f5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/libfort/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,39 @@ else()
set(ADDITIONAL_WARNINGS "\
-Wall \
-Wextra \
-Wdouble-promotion \
-Wshadow \
-Wformat=2 \
-Wno-variadic-macros \
-Wcast-align \
-Wstrict-aliasing=2 \
-Wstrict-overflow=5 \
-Wfloat-equal \
-Wwrite-strings \
")
if(NOT "${FORT_COMPILER}" STREQUAL "Intel")
set(ADDITIONAL_WARNINGS "${ADDITIONAL_WARNINGS} \
-Wdouble-promotion \
-Wcast-align \
-Wstrict-overflow=5 \
")
endif()
#Supress
if("${FORT_COMPILER}" STREQUAL "Intel")
set(ADDITIONAL_WARNINGS "${ADDITIONAL_WARNINGS} \
-wd279 \
-wd2192 \
-wd2102")
-wd2102 \
-diag-disable:remark \
")
endif()
if("${FORT_COMPILER}" STREQUAL "GNU")
set(ADDITIONAL_WARNINGS "${ADDITIONAL_WARNINGS} \
-Wtrampolines \
-Wlogical-op")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_WARNINGS} -Wpedantic")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_WARNINGS}")
if(NOT "${FORT_COMPILER}" STREQUAL "Intel")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_WARNINGS}")
endif()

Expand Down

0 comments on commit 033a6f5

Please sign in to comment.