File: SetCCWarnFlags.cmake

package info (click to toggle)
s3d 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,708 kB
  • sloc: ansic: 23,609; python: 488; perl: 98; makefile: 31; sh: 29
file content (28 lines) | stat: -rw-r--r-- 834 bytes parent folder | download | duplicates (4)
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
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2007-2015  Sven Eckelmann <sven@narfation.org>

include(CheckCCompilerFlag)

# Enable all warnings if possible (gnu cc)
check_c_compiler_flag("-Wall" SUPPORT_WALL)
if (SUPPORT_WALL)
	add_definitions("-Wall")
endif (SUPPORT_WALL)

# Enable even more warnings if possible (gnu cc)
check_c_compiler_flag("-Wextra" SUPPORT_WEXTRA)
if (SUPPORT_WEXTRA)
	add_definitions("-Wextra")
else (SUPPORT_WEXTRA)
	# try to enable extra warnings on old gcc versions
	check_c_compiler_flag("-W" SUPPORT_WEXTRAOLD)
	if (SUPPORT_WEXTRAOLD)
		add_definitions("-W")
	endif (SUPPORT_WEXTRAOLD)
endif (SUPPORT_WEXTRA)

# Enable pedantic mode if possible (gnu cc)
check_c_compiler_flag("-pedantic" SUPPORT_PEDANTIC)
if (SUPPORT_PEDANTIC)
	add_definitions("-pedantic")
endif (SUPPORT_PEDANTIC)