about summary refs log tree commit diff homepage
path: root/cmake/compiler_warnings.cmake
blob: b8d00a6ba76d08bd7e60597f1741f86c69a8a9dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#===------------------------------------------------------------------------===#
#
#                     The KLEE Symbolic Virtual Machine
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#

###############################################################################
# Compiler warnings
#
# NOTE: All these variables should be lists of flags and NOT a single string.
###############################################################################
# FIXME: -Wunused-parameter fires a lot so for now suppress it.
add_compile_options(
  "-Wall"
  "-Wextra"
  "-Wno-unused-parameter"
)

###############################################################################
# Warnings as errors
###############################################################################
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
if (WARNINGS_AS_ERRORS)
  add_compile_options("-Werror")
  message(STATUS "Treating compiler warnings as errors")
else()
  message(STATUS "Not treating compiler warnings as errors")
endif()