Fix Clang detection: the correct compiler id for clang on macos is AppleClang, not Clang

This commit is contained in:
Nikita Lisitsa 2021-01-18 20:01:10 +03:00
parent b2996f426b
commit fce03995d8

View file

@ -12,7 +12,7 @@ if(PSEMEK_BUILD_TYPE STREQUAL "DEBUG")
endif()
set(PSEMEK_CXX_FLAGS)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
list(APPEND PSEMEK_CXX_FLAGS -Wall -Werror -Wextra -pedantic -Wno-narrowing -Wno-sign-compare)
endif()
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
@ -20,7 +20,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
list(APPEND PSEMEK_CXX_FLAGS -Wno-maybe-uninitialized)
endif()
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
# gives false-positive on audio::engine::impl::~impl
# -Wdtor-name gives false-positive on audio::engine::impl::~impl
list(APPEND PSEMEK_CXX_FLAGS -Wno-dtor-name)
endif()