From 8b64f825058a2439903e9420552641ca6105d9d6 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 13 Oct 2014 09:52:28 +0200 Subject: Bug#17633291: SET PROPER COMPILE OPTIONS FOR CLANG Bug#17959689: MAKE GCC AND CLANG GIVE CONSISTENT COMPILATION WARNINGS Bug#18313717: ENABLE -WERROR IN MAINTANER MODE WHEN COMPILING WITH CLANG Bug#18510941: REMOVE CMAKE WORKAROUNDS FOR OLDER VERSIONS OF OS X/XCODE Backport from mysql-5.6 to mysql-5.5 --- libmysqld/CMakeLists.txt | 8 ++++++++ libmysqld/examples/CMakeLists.txt | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'libmysqld') diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index f31aa819ed5..abbf887e1e6 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -93,6 +93,14 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ) +# These files have unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(../sql/filesort.cc COMPILE_FLAGS "-Wno-error") + ADD_COMPILE_FLAGS(../sql/opt_range.cc COMPILE_FLAGS "-Wno-error") +ENDIF() + ADD_CONVENIENCE_LIBRARY(sql_embedded ${SQL_EMBEDDED_SOURCES}) DTRACE_INSTRUMENT(sql_embedded) ADD_DEPENDENCIES(sql_embedded GenError GenServerSource) diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index c4055a56303..55b2079c320 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -33,6 +33,12 @@ IF(UNIX) ENDIF(UNIX) MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc) +# mysqltest has unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(../../client/mysqltest.cc COMPILE_FLAGS "-Wno-error") +ENDIF() TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver) -- cgit v1.2.1