mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
This change explicitly adds -Werror to the CFLAGS. Due to the way that the ADD_C_FLAG_IF_SUPPORTED() macro was mangling the flag name to convert it into a define name, any warning that had a dash in its name was not being correctly enabled. Additionally, any flag that is enabled implicitly by the compiler (like -Wunused-result and -Wdeprecated-declarations) would not cause an error unless they were explicitly enabled with the ENABLE_WARNINGS() macro.
12 lines
216 B
CMake
12 lines
216 B
CMake
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)
|
|
ADD_C_FLAG_IF_SUPPORTED(-Werror)
|
|
ENDIF()
|