Added compilation warning flags for the Intel compiler.
This commit is contained in:
@@ -128,18 +128,14 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}\
|
|||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}\
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}\
|
||||||
-O0 -g")
|
-O0 -g")
|
||||||
|
|
||||||
set (CXX_FLAGS_WARNING "-Wall -Wextra -Werror")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
set (CXX_FLAGS_WARNING "-Wall -Wextra -Werror -Wdouble-promotion -Wfloat-conversion")
|
||||||
# Also warn about implicit conversions if the compiler supports it
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
set (CXX_FLAGS_WARNING "-Wall -Wextra -Werror-all -Wsign-conversion")
|
||||||
set (CXX_FLAGS_WARNING "${CXX_FLAGS_WARNING} -Wdouble-promotion -Wfloat-conversion")
|
else()
|
||||||
|
message(WARNING "Using an unknown compiler. Compilation warning flags were not set.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Other flags. -D_FORCE_INLINES is a workaround to some CUDA/C++ "feature"
|
|
||||||
# which botches the compilation ("memcpy was not declared in this scope")
|
|
||||||
# (Not required with cc >= 3.0)
|
|
||||||
#set(CXX_FLAGS_ETC "-D_FORCE_INLINES")
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}\
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}\
|
||||||
${CXX_FLAGS_WARNING}\
|
${CXX_FLAGS_WARNING}\
|
||||||
${CXX_FLAGS_ETC}\
|
${CXX_FLAGS_ETC}\
|
||||||
|
Reference in New Issue
Block a user