Check for Clang before adding compiler flag

See eb565a1ce2
This commit is contained in:
warptangent 2015-05-13 09:14:15 -07:00
parent 867e98d739
commit 5c025f99a8
No known key found for this signature in database
GPG key ID: 0E490BEBFBE4E92D

View file

@ -213,7 +213,10 @@ else()
else() else()
set(ARCH_FLAG "-march=${ARCH}") set(ARCH_FLAG "-march=${ARCH}")
endif() endif()
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-deprecated-register") set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(WARNINGS "${WARNINGS} -Wno-deprecated-register")
endif()
if(NOT MINGW) if(NOT MINGW)
set(WARNINGS "${WARNINGS} -Werror") # to allow pedantic but not stop compilation set(WARNINGS "${WARNINGS} -Werror") # to allow pedantic but not stop compilation
endif() endif()