summaryrefslogtreecommitdiff
path: root/cmake/EnableWarnings.cmake
blob: b61ed7e90d4b602a302188a7d3ba1e3a075e83b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MACRO(ENABLE_WARNINGS flag)
	ADD_C_FLAG_IF_SUPPORTED(-W${flag})
ENDMACRO()

MACRO(DISABLE_WARNINGS flag)
	ADD_C_FLAG_IF_SUPPORTED(-Wno-${flag})
ENDMACRO()

IF(ENABLE_WERROR)
	IF(MSVC)
		ADD_COMPILE_OPTIONS(-WX)
	ELSE()
		ADD_C_FLAG_IF_SUPPORTED(-Werror)
	ENDIF()
ENDIF()