Skip to content

Commit

Permalink
Avoid conversion warnings being treated as errors (#244)
Browse files Browse the repository at this point in the history
* conversion and sign-conversion only as warnings
* Avoid adding non-supported flags to ICC
  • Loading branch information
ferdonline committed Nov 4, 2019
1 parent 93d877b commit b9b25da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMake/config/CompilerFlagsHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})

## GCC, CLANG, rest of the world
else()
set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall -Wextra -Werror -Wshadow -Wnon-virtual-dtor -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wdouble-promotion -Wformat=2 -Wconversion -Wsign-conversion")
string(APPEND CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL
" -Wall -Wextra -Werror -Wshadow -Wnon-virtual-dtor -Wunused -Woverloaded-virtual"
" -Wformat=2 -Wconversion -Wsign-conversion"
" -Wno-error=conversion -Wno-error=sign-conversion") # Too common to be considered errors
if(NOT CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_ICC)
string(APPEND CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL " -Wcast-align -Wpedantic -Wdouble-promotion")
endif()

set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g")

Expand Down

0 comments on commit b9b25da

Please sign in to comment.