if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set(WARNING_FLAGS "-Wall -Wextra -Wpedantic -Wno-missing-field-initializers")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    set(WARNING_FLAGS "-Wall -Wextra -Wpedantic -Wno-missing-field-initializers")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
    set(WARNING_FLAGS "-w3 -wd1418,2259")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
    set(WARNING_FLAGS "/W4")
else ()
    message(WARNING "Unknown compiler - cannot set warning flags")
endif()

if(WARNING_FLAGS)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
	string(REGEX REPLACE "/W[0-3] " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

