diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index cef376787cc85c..3db6acaf6920b3 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -408,7 +408,12 @@ message(STATUS "${LINUX_VERSION_LOWER}") # message(FATAL_ERROR "Currently not support system ${LINUX_VERSION}") # endif() +if(DEFINED ENV{CLANG_COMPATIBLE_FLAGS}) + set(CLANG_COMPATIBLE_FLAGS $ENV{CLANG_COMPATIBLE_FLAGS}) +endif() + message(STATUS "CLANG_BASE_FLAGS: ${CLANG_BASE_FLAGS}") +message(STATUS "CLANG_COMPATIBLE_FLAGS: ${CLANG_COMPATIBLE_FLAGS}") set(CLANG_INCLUDE_FLAGS "-I${LLVM_HOME}/include" @@ -419,6 +424,7 @@ set(CLANG_INCLUDE_FLAGS "-I${THIRDPARTY_DIR}/include/event/" "-I${GPERFTOOLS_HOME}/include" ${CLANG_BASE_FLAGS} + ${CLANG_COMPATIBLE_FLAGS} ) # Set include dirs diff --git a/env.sh b/env.sh index 543054552a3adb..6c817685b0051e 100755 --- a/env.sh +++ b/env.sh @@ -80,3 +80,8 @@ if [[ ! "$(printf '%s\n' "$required_ver" "$gcc_ver" | sort -V | head -n1)" = "$r exit 1 fi +# export CLANG COMPATIBLE FLAGS +export CLANG_COMPATIBLE_FLAGS=`echo | ${DORIS_GCC_HOME}/bin/gcc -Wp,-v -xc++ - -fsyntax-only 2>&1 \ + | grep -E '^\s+/' | awk '{print "-I" $1}' | tr '\n' ' '` + +