Build: Correct AppleClang warning handling.

This commit is contained in:
Unknown W. Brackets 2021-12-11 10:45:05 -08:00
parent ce3e29a649
commit 35a5f257f5

View File

@ -13,7 +13,8 @@ enable_language(ASM)
add_definitions(-D__STDC_CONSTANT_MACROS)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
# Include AppleClang and Clang.
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CLANG ON)
message("Clang enabled")
endif()
@ -306,7 +307,6 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if(CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-uninitialized")
add_definitions(-Wno-nullability-completeness)
add_definitions(-Wno-tautological-pointer-compare)
add_definitions(-Wno-deprecated-register)
@ -362,7 +362,7 @@ if(NOT MSVC)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
elseif(NOT ANDROID)
# TODO: See if we can get rid of no-psabi
if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Intel" AND NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Intel" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
add_definitions(-Wno-psabi)
endif()
add_definitions(-D_XOPEN_SOURCE=700)