added compilation flags for clang

This commit is contained in:
andrey.zhirnov
2019-06-19 15:07:49 +03:00
parent 12f6f9d4eb
commit e57df8b8d4

View File

@@ -33,6 +33,22 @@ if(MSVC)
endif()
endif(MSVC)
set(shared_cxx_flags "")
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(shared_cxx_flags "-std=c++1z -Wformat -Wno-switch -Wno-switch-enum -Wno-c++1z-extensions -Wloop-analysis -Wincrement-bool -Werror=init-self -Werror=self-assign -Werror=self-move -Werror=infinite-recursion -Werror=dangling-else -Werror=large-by-value-copy -Werror=instantiation-after-specialization -Werror=array-bounds -Werror=address -Werror=missing-field-initializers")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
endif()
# append cxx flags for each configuration
foreach(config ${all_cxx_configs})
set(${config} "${${config}} ${shared_cxx_flags}")
endforeach()
#
# coverage mode
#