about summary refs log tree commit diff homepage
path: root/cmake/compiler_warnings.cmake
blob: b250483a1da2ec60aea7148ea2b15e348f8257a8 (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
#===------------------------------------------------------------------------===#
#
#                     The KLEE Symbolic Virtual Machine
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#

###############################################################################
# Compiler warnings
###############################################################################
# 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()