# Copyright (c) 2018 David 'Mokon' Bond <mokon@mokon.net>
# Author: David 'Mokon' Bond <mokon@mokon.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" "-std=c++17")
list(APPEND CMAKE_CXX_WARNINGS
  "-W"
  "-Waddress"
  "-Waggressive-loop-optimizations"
  "-Wall"
  "-Warray-bounds=2"
  #"-Wattributes"
  "-Wbool-compare"
  "-Wbuiltin-macro-redefined"
  "-Wcast-align"
  "-Wcast-qual"
  "-Wchar-subscripts"
  "-Wchkp"
  "-Wclobbered"
  "-Wcomment"
  "-Wcomments"
  "-Wconversion"
  "-Wcoverage-mismatch"
  "-Wcpp"
  "-Wdate-time"
  "-Wdeprecated"
  "-Wdeprecated-declarations"
  "-Wdisabled-optimization"
  "-Wdiv-by-zero"
  "-Wdouble-promotion"
  "-Wduplicated-cond"
  "-Wempty-body"
  "-Wendif-labels"
  "-Wenum-compare"
  "-Werror"
  "-Werror-implicit-function-declaration"
  "-Wextra"
  "-Wfatal-errors"
  "-Wfloat-conversion"
  "-Wfloat-equal"
  "-Wformat"
  "-Wformat-contains-nul"
  "-Wformat-extra-args"
  "-Wformat-nonliteral"
  "-Wformat-security"
  "-Wformat-signedness"
  "-Wformat-y2k"
  "-Wformat-zero-length"
  "-Wframe-address"
  "-Wfree-nonheap-object"
  "-Whsa"
  "-Wignored-attributes"
  "-Wignored-qualifiers"
  "-Wimport"
  "-Winit-self"
  #"-Winline"
  "-Wint-to-pointer-cast"
  "-Winvalid-memory-model"
  "-Winvalid-pch"
  "-Wlogical-not-parentheses"
  "-Wlogical-op"
  "-Wlong-long"
  "-Wlto-type-mismatch"
  "-Wmain"
  "-Wmaybe-uninitialized"
  "-Wmemset-transposed-args"
  "-Wmisleading-indentation"
  "-Wmissing-braces"
  "-Wmissing-declarations"
  "-Wmissing-field-initializers"
  "-Wmissing-format-attribute"
  "-Wmissing-include-dirs"
  "-Wmissing-noreturn"
  "-Wmultichar"
  "-Wnarrowing"
  "-Wnonnull"
  "-Wnonnull-compare"
  "-Wnormalized"
  "-Wnull-dereference"
  "-Wodr"
  "-Wopenmp-simd"
  "-Woverflow"
  "-Woverlength-strings"
  "-Wpacked"
  "-Wpacked-bitfield-compat"
  #"-Wpadded"
  "-Wparentheses"
  "-Wpedantic"
  "-Wpointer-arith"
  "-Wpragmas"
  "-Wpsabi"
  "-Wredundant-decls"
  "-Wreturn-local-addr"
  "-Wreturn-type"
  "-Wscalar-storage-order"
  "-Wsequence-point"
  "-Wshadow"
  "-Wshift-count-negative"
  "-Wshift-count-overflow"
  "-Wshift-negative-value"
  "-Wshift-overflow=2"
  "-Wsign-compare"
  "-Wsign-conversion"
  "-Wsizeof-array-argument"
  "-Wsizeof-pointer-memaccess"
  "-Wstack-protector"
  "-Wstrict-aliasing"
  "-Wstrict-overflow"
  "-Wsuggest-attribute=const"
  "-Wsuggest-attribute=format"
  "-Wsuggest-attribute=noreturn"
  "-Wsuggest-final-methods"
  "-Wsuggest-final-types"
  "-Wswitch"
  "-Wswitch-bool"
  #"-Wswitch-default"
  "-Wswitch-enum"
  "-Wsync-nand"
  "-Wtautological-compare"
  "-Wtrampolines"
  "-Wtrigraphs"
  "-Wtype-limits"
  "-Wundef"
  "-Wuninitialized"
  "-Wunknown-pragmas"
  "-Wunreachable-code"
  "-Wunsafe-loop-optimizations"
  "-Wunused"
  "-Wunused-but-set-parameter"
  "-Wunused-but-set-variable"
  "-Wunused-const-variable"
  "-Wunused-function"
  "-Wunused-label"
  "-Wunused-local-typedefs"
  "-Wunused-macros"
  "-Wunused-parameter"
  "-Wunused-result"
  "-Wunused-value"
  "-Wunused-variable"
  "-Wvarargs"
  "-Wvariadic-macros"
  "-Wvector-operation-performance"
  "-Wvla"
  "-Wvolatile-register-var"
  "-Wwrite-strings")
