From 3a85f5076c37cf914b8fc81d3912745aa3f9aadf Mon Sep 17 00:00:00 2001 From: shuke987 Date: Tue, 2 Sep 2025 15:24:59 +0800 Subject: [PATCH 1/2] [fix](compile) ignore gen_cpp compile warnings --- be/CMakeLists.txt | 4 +--- be/src/gen_cpp/CMakeLists.txt | 13 +++++++++++++ cloud/src/gen-cpp/CMakeLists.txt | 13 +++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index be2b53f8e81df6..53cfcde7e8f297 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -280,7 +280,6 @@ add_compile_options(-g -gdwarf-5 -Wall -Wextra - -Werror -Wundef -pthread -fstrict-aliasing @@ -321,9 +320,8 @@ if (COMPILER_CLANG) -Wconversion) add_compile_options( -Wno-gnu-statement-expression -Wno-implicit-float-conversion - -Wno-implicit-int-conversion -Wno-sign-conversion - -Wno-shorten-64-to-32) + ) if (USE_LIBCPP) add_compile_options($<$:-stdlib=libc++>) add_definitions(-DUSE_LIBCPP) diff --git a/be/src/gen_cpp/CMakeLists.txt b/be/src/gen_cpp/CMakeLists.txt index 437377f14652fa..e5452571f3b175 100644 --- a/be/src/gen_cpp/CMakeLists.txt +++ b/be/src/gen_cpp/CMakeLists.txt @@ -30,6 +30,19 @@ add_compile_options(-Wno-return-type) # each other add_library(DorisGen 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 + ) +endif() + # Setting these files as code-generated lets make clean and incremental builds work # correctly # set_source_files_properties(${SRC_FILES} PROPERTIES GENERATED TRUE) diff --git a/cloud/src/gen-cpp/CMakeLists.txt b/cloud/src/gen-cpp/CMakeLists.txt index 596598e1361044..fb0bfb6385e155 100644 --- a/cloud/src/gen-cpp/CMakeLists.txt +++ b/cloud/src/gen-cpp/CMakeLists.txt @@ -13,6 +13,19 @@ 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 + ) +endif() + # Setting these files as code-generated lets make clean and incremental builds # work correctly set_source_files_properties(${SRC_FILES} PROPERTIES GENERATED TRUE) From 9a09e9bb45b9dd4df851767414643c079614e0f7 Mon Sep 17 00:00:00 2001 From: shuke987 Date: Thu, 4 Sep 2025 19:38:22 +0800 Subject: [PATCH 2/2] 2 --- be/CMakeLists.txt | 1 + be/src/gen_cpp/CMakeLists.txt | 5 ++--- cloud/src/gen-cpp/CMakeLists.txt | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index 53cfcde7e8f297..8e92f191699f4e 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -280,6 +280,7 @@ add_compile_options(-g -gdwarf-5 -Wall -Wextra + -Werror -Wundef -pthread -fstrict-aliasing diff --git a/be/src/gen_cpp/CMakeLists.txt b/be/src/gen_cpp/CMakeLists.txt index e5452571f3b175..dbe33c40ea9ef2 100644 --- a/be/src/gen_cpp/CMakeLists.txt +++ b/be/src/gen_cpp/CMakeLists.txt @@ -31,15 +31,14 @@ add_compile_options(-Wno-return-type) add_library(DorisGen 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 + target_compile_options(DorisGen 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 ) endif() diff --git a/cloud/src/gen-cpp/CMakeLists.txt b/cloud/src/gen-cpp/CMakeLists.txt index fb0bfb6385e155..cee347551a9b75 100644 --- a/cloud/src/gen-cpp/CMakeLists.txt +++ b/cloud/src/gen-cpp/CMakeLists.txt @@ -23,6 +23,8 @@ if(CMAKE_CXX_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-deprecated-declarations -Wno-unused-parameter -Wno-missing-field-initializers + -Wno-shorten-64-to-32 + -Wno-implicit-int-conversion ) endif()