From e9086988b1cce9a2ae949a019cad584c43839385 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 23 Oct 2024 06:37:32 -0700 Subject: [PATCH] build: disable shadow warnings on AppleClang --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe2dce4b..90cfaaf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,12 +102,13 @@ project_options(ENABLE_CACHE ENABLE_COMPILE_COMMANDS_SYMLINK) file(GLOB_RECURSE SOURCES "./src/*.cc") add_library(addon SHARED ${SOURCES}) -if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) +if(CMAKE_CXX_COMPILER_ID STREQUAL GNU + OR CMAKE_CXX_COMPILER_ID STREQUAL Clang + OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) target_compile_options(project_warnings INTERFACE "-Wno-shadow") endif() target_link_libraries(addon PRIVATE project_options project_warnings) - if(ZMQ_DRAFT) target_compile_definitions(addon PRIVATE ZMQ_BUILD_DRAFT_API) endif()