diff --git a/contrib/azure-cmake/CMakeLists.txt b/contrib/azure-cmake/CMakeLists.txt index 7f9476e37b7..ed428364598 100644 --- a/contrib/azure-cmake/CMakeLists.txt +++ b/contrib/azure-cmake/CMakeLists.txt @@ -46,14 +46,17 @@ include("${AZURE_DIR}/cmake-modules/AzureTransportAdapters.cmake") add_library(azure_sdk ${AZURE_SDK_UNIFIED_SRC}) if (COMPILER_CLANG) - target_compile_options(azure_sdk PUBLIC + target_compile_options(azure_sdk PRIVATE -Wno-deprecated-copy-dtor -Wno-extra-semi -Wno-suggest-destructor-override -Wno-inconsistent-missing-destructor-override -Wno-error=unknown-warning-option - -Wno-reserved-identifier ) + + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13) + target_compile_options(azure_sdk PRIVATE -Wno-reserved-identifier) + endif() endif() # Originally, on Windows azure-core is built with bcrypt and crypt32 by default diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bca9bd9d280..428f817ac49 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -385,6 +385,20 @@ dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${PDQSORT_INCLUDE_DIR}) target_include_directories(clickhouse_common_io BEFORE PUBLIC ${MINISELECT_INCLUDE_DIR}) dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${MINISELECT_INCLUDE_DIR}) +macro (add_check_flag_definitions flag modules) + if (${flag}) + if (MAKE_STATIC_LIBRARIES OR NOT SPLIT_SHARED_LIBRARIES) + target_compile_definitions(clickhouse_common_io PRIVATE ${flag}) + target_compile_definitions(dbms PRIVATE ${flag}) + else () + foreach (module ${modules}) + target_compile_definitions(${module} PRIVATE ${flag}) + endforeach () + endif () + endif () +endmacro () +add_check_flag_definitions(HAS_SUGGEST_DESTRUCTOR_OVERRIDE "clickhouse_common_io;clickhouse_disks") + if (ZSTD_LIBRARY) dbms_target_link_libraries(PRIVATE ${ZSTD_LIBRARY}) target_link_libraries (clickhouse_common_io PUBLIC ${ZSTD_LIBRARY}) diff --git a/src/Disks/BlobStorage/BlobStorageAuth.h b/src/Disks/BlobStorage/BlobStorageAuth.h index 16a088fc960..04abc2fd643 100644 --- a/src/Disks/BlobStorage/BlobStorageAuth.h +++ b/src/Disks/BlobStorage/BlobStorageAuth.h @@ -7,8 +7,26 @@ #if USE_AZURE_BLOB_STORAGE #include + +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" +# pragma clang diagnostic ignored "-Wdeprecated-copy-dtor" +# pragma clang diagnostic ignored "-Wextra-semi" +# ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE +# pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# endif +# ifdef HAS_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif +#endif + #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + namespace DB { diff --git a/src/Disks/BlobStorage/DiskBlobStorage.h b/src/Disks/BlobStorage/DiskBlobStorage.h index 16ba216df96..d124a133eb2 100644 --- a/src/Disks/BlobStorage/DiskBlobStorage.h +++ b/src/Disks/BlobStorage/DiskBlobStorage.h @@ -11,9 +11,25 @@ #include #include +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" +# pragma clang diagnostic ignored "-Wdeprecated-copy-dtor" +# pragma clang diagnostic ignored "-Wextra-semi" +# ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE +# pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# endif +# ifdef HAS_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif +#endif + #include #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif namespace DB { diff --git a/src/Disks/IO/ReadBufferFromRemoteFSGather.h b/src/Disks/IO/ReadBufferFromRemoteFSGather.h index 045ab43850d..6bef9488d05 100644 --- a/src/Disks/IO/ReadBufferFromRemoteFSGather.h +++ b/src/Disks/IO/ReadBufferFromRemoteFSGather.h @@ -6,7 +6,26 @@ #include #if USE_AZURE_BLOB_STORAGE + +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" +# pragma clang diagnostic ignored "-Wdeprecated-copy-dtor" +# pragma clang diagnostic ignored "-Wextra-semi" +# ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE +# pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# endif +# ifdef HAS_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif +#endif + #include + +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + #endif namespace Aws diff --git a/src/IO/ReadBufferFromBlobStorage.h b/src/IO/ReadBufferFromBlobStorage.h index cd66e897e25..029b53641eb 100644 --- a/src/IO/ReadBufferFromBlobStorage.h +++ b/src/IO/ReadBufferFromBlobStorage.h @@ -9,8 +9,26 @@ #include #include #include + +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" +# pragma clang diagnostic ignored "-Wdeprecated-copy-dtor" +# pragma clang diagnostic ignored "-Wextra-semi" +# ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE +# pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# endif +# ifdef HAS_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif +#endif + #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + namespace DB { diff --git a/src/IO/WriteBufferFromBlobStorage.h b/src/IO/WriteBufferFromBlobStorage.h index 5f8eaba3c0c..4bb995f907d 100644 --- a/src/IO/WriteBufferFromBlobStorage.h +++ b/src/IO/WriteBufferFromBlobStorage.h @@ -10,9 +10,26 @@ #include #include + +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" +# pragma clang diagnostic ignored "-Wdeprecated-copy-dtor" +# pragma clang diagnostic ignored "-Wextra-semi" +# ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE +# pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# endif +# ifdef HAS_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif +#endif + #include #include +#if defined(__clang__) +# pragma clang diagnostic pop +#endif namespace DB {