From 3ec6820a928849a1de07f963ee0fcef18ff82dcc Mon Sep 17 00:00:00 2001 From: Anton Yuzhaninov Date: Tue, 30 Oct 2018 14:45:51 -0400 Subject: [PATCH] Don't use LLVM_CXX_FLAGS/LLVM_C_FLAGS llvm-config --cxxflags shows CFLAGS used to compile clang. If clang installed from package and package was build using GCC then it will contain GCC specific flags. In case of clang installed as RPM packge -specs= flags also added. There is not point to use them to compile plugin. For now hardcode flags in clang-plugin/CMakeLists.txt Add -O2 - we want plugin to work fast even if we to compiling rspamd code with -O0. --- clang-plugin/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-plugin/CMakeLists.txt b/clang-plugin/CMakeLists.txt index 525d3b57a..62a1d68f5 100644 --- a/clang-plugin/CMakeLists.txt +++ b/clang-plugin/CMakeLists.txt @@ -54,7 +54,7 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") ADD_LIBRARY(rspamd-clang SHARED ${CLANGPLUGINSRC}) SET_TARGET_PROPERTIES(rspamd-clang PROPERTIES - COMPILE_FLAGS "${LLVM_CXX_FLAGS} ${LLVM_CPP_FLAGS} ${LLVM_C_FLAGS}" + COMPILE_FLAGS "${LLVM_CPP_FLAGS} -O2 -Wall -Wextra -Wno-unused-parameter -Werror" INCLUDE_DIRECTORIES ${LIBCLANG_INCLUDE_DIR} LINKER_LANGUAGE CXX) TARGET_LINK_LIBRARIES(rspamd-clang ${LIBCLANG_LIBRARIES}) -- 2.39.5