diff --git a/be/src/gen_cpp/CMakeLists.txt b/be/src/gen_cpp/CMakeLists.txt index e91b5e29c141b8..dbe33c40ea9ef2 100644 --- a/be/src/gen_cpp/CMakeLists.txt +++ b/be/src/gen_cpp/CMakeLists.txt @@ -30,10 +30,15 @@ add_compile_options(-Wno-return-type) # each other add_library(DorisGen STATIC ${SRC_FILES}) -if (COMPILER_CLANG) +if(CMAKE_CXX_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(DorisGen PRIVATE - -Wno-implicit-int-conversion - -Wno-shorten-64-to-32 + -Wno-unused-variable + -Wno-sign-compare + -Wno-unused-function + -Wno-deprecated-declarations + -Wno-unused-parameter + -Wno-missing-field-initializers + -Wno-shorten-64-to-32 ) endif() diff --git a/cloud/src/gen-cpp/CMakeLists.txt b/cloud/src/gen-cpp/CMakeLists.txt index 596598e1361044..cee347551a9b75 100644 --- a/cloud/src/gen-cpp/CMakeLists.txt +++ b/cloud/src/gen-cpp/CMakeLists.txt @@ -13,6 +13,21 @@ set(SRC_FILES # each other add_library(CloudGen STATIC ${SRC_FILES}) +if(CMAKE_CXX_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(CloudGen PRIVATE -Wno-error) + + target_compile_options(CloudGen PRIVATE + -Wno-unused-variable + -Wno-sign-compare + -Wno-unused-function + -Wno-deprecated-declarations + -Wno-unused-parameter + -Wno-missing-field-initializers + -Wno-shorten-64-to-32 + -Wno-implicit-int-conversion + ) +endif() + # Setting these files as code-generated lets make clean and incremental builds # work correctly set_source_files_properties(${SRC_FILES} PROPERTIES GENERATED TRUE)