commit e6734e824a3202a4894146ec637584b9ca846d60 Author: Laurynas Biveinis Date: Thu Jan 26 11:06:01 2017 +0200 Fix bug 84842 (System header warnings should be suppressed properly) Replace -I with -isystem in the compiler flags, and add SYSTEM attribute to CMake INCLUDE_DIRECTORIES where appropriate. This affects the following include paths: BOOST_INCLUDE_DIR, PROTOBUF_INCLUDE_DIRS, LIBEVENT_INCLUDE_DIR, SSL_INCLUDE_DIRS, GMOCK_INCLUDE_DIRS, GTEST_INCLUDE_DIR, ZLIB_INCLUDE_DIR, LZ4_INCLUDE_DIR, EDITLINE_INCLUDE_DIR, MECAB_INCLUDE_DIR, MEMCACHED_INCLUDE_DIR, NODE_INCLUDES, JNI_INCLUDE_DIRS. Turn back some of the warnings which have been disabled even though they originate in the system headers. Fix warnings exposed by the above. diff --git a/CMakeLists.txt b/CMakeLists.txt index 44842d36bcb..35aec0d1166 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -472,9 +472,10 @@ INCLUDE(configure.cmake) ADD_DEFINITIONS(-DHAVE_CONFIG_H) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/extra/rapidjson/include ${CMAKE_CURRENT_BINARY_DIR}/libbinlogevents/include ${CMAKE_SOURCE_DIR}/libbinlogevents/export) +INCLUDE_DIRECTORIES(SYSTEM + ${CMAKE_SOURCE_DIR}/extra/rapidjson/include) # Add bundled or system zlib. MYSQL_CHECK_ZLIB_WITH_COMPRESS() # Add bundled yassl/taocrypt or system openssl. diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e5d73473db6..d4feb1e1345 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -17,17 +17,20 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/client ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys_ssl - ${ZLIB_INCLUDE_DIR} - ${LZ4_INCLUDE_DIR} - ${SSL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/libmysql ${CMAKE_SOURCE_DIR}/libbinlogevents/include ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/strings - ${EDITLINE_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) +INCLUDE_DIRECTORIES(SYSTEM + ${ZLIB_INCLUDE_DIR} + ${LZ4_INCLUDE_DIR} + ${SSL_INCLUDE_DIRS} + ${EDITLINE_INCLUDE_DIR} +) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) ## Subdirectory with common client code. @@ -52,7 +55,7 @@ IF(NOT WITHOUT_SERVER) upgrade/program.cc ) ADD_COMPILE_FLAGS( - upgrade/program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + upgrade/program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient client_base mysqlcheck_core) ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs GenSysSchema) diff --git a/client/base/CMakeLists.txt b/client/base/CMakeLists.txt index 91cce4c8ecb..b206de7ee82 100644 --- a/client/base/CMakeLists.txt +++ b/client/base/CMakeLists.txt @@ -49,7 +49,7 @@ ADD_COMPILE_FLAGS( mutex.cc mysql_query_runner.cc show_variable_query_extractor.cc - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) TARGET_LINK_LIBRARIES(client_base mysqlclient) diff --git a/client/dump/CMakeLists.txt b/client/dump/CMakeLists.txt index bae2ce76315..a967ce8fc7f 100644 --- a/client/dump/CMakeLists.txt +++ b/client/dump/CMakeLists.txt @@ -50,7 +50,7 @@ IF(USING_LOCAL_BOOST) ADD_COMPILE_FLAGS( ${BOOST_LIB_SOURCES} - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) IF(HAVE_clock_gettime_IN_rt) @@ -145,41 +145,17 @@ TARGET_LINK_LIBRARIES(mysqlpump_lib ADD_COMPILE_FLAGS( ${MYSQLPUMP_LIB_SOURCES} - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) -# Files that use Boost sources that trigger compilation warnings -SET(MYSQLPUMP_BOOST_SOURCES - abstract_crawler.cc - abstract_mysql_chain_element_extension.cc - abstract_progress_watcher.cc - mysql_chain_element_options.cc - mysql_object_reader.cc - mysqldump_tool_chain_maker.cc - mysqldump_tool_chain_maker_options.cc - object_filter.cc - object_queue.cc - program.cc - standard_progress_watcher.cc - sql_formatter.cc - table.cc -) - -# Boost source has unused local typedefs. -MY_CHECK_CXX_COMPILER_FLAG("-Wunused-local-typedefs" HAVE_UNUSED_TYPEDEFS) -IF(HAVE_UNUSED_TYPEDEFS) - ADD_COMPILE_FLAGS(${MYSQLPUMP_BOOST_SOURCES} - COMPILE_FLAGS "-Wno-unused-local-typedefs") -ENDIF() - ADD_COMPILE_FLAGS( compression_writer.cc mysqldump_tool_chain_maker.cc - COMPILE_FLAGS -I${LZ4_INCLUDE_DIR} + COMPILE_FLAGS -isystem ${LZ4_INCLUDE_DIR} ) MYSQL_ADD_EXECUTABLE(mysqlpump program.cc) ADD_COMPILE_FLAGS( - program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + program.cc COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) TARGET_LINK_LIBRARIES(mysqlpump mysqlpump_lib ${LOCAL_BOOST_LIB}) diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 9912826ae04..3c710a6d584 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -61,7 +61,9 @@ MACRO(MYSQL_ADD_PLUGIN) ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/libbinlogevents/include ${CMAKE_SOURCE_DIR}/sql/auth - ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/regex) + + INCLUDE_DIRECTORIES(SYSTEM ${SSL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index 3adf988a219..e3520bff835 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -13,10 +13,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +INCLUDE_DIRECTORIES(SYSTEM +${ZLIB_INCLUDE_DIR} +${LZ4_INCLUDE_DIR}) + INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include -${ZLIB_INCLUDE_DIR} -${LZ4_INCLUDE_DIR} # Following is for perror, in case NDB is compiled in. ${CMAKE_SOURCE_DIR}/storage/ndb/include ${CMAKE_BINARY_DIR}/storage/ndb/include @@ -106,7 +108,7 @@ IF(WITH_INNOBASE_STORAGE_ENGINE) IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY) ADD_DEFINITIONS(-DHAVE_LZ4=1) - INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(SYSTEM ${LZ4_INCLUDE_DIR}) ENDIF() # Add path to the InnoDB headers diff --git a/extra/protobuf/CMakeLists.txt b/extra/protobuf/CMakeLists.txt index 7c7e97e32e5..97764b23982 100644 --- a/extra/protobuf/CMakeLists.txt +++ b/extra/protobuf/CMakeLists.txt @@ -71,6 +71,9 @@ ENDIF() INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/protobuf-2.6.1/src +) + +INCLUDE_DIRECTORIES(SYSTEM ${ZLIB_INCLUDE_DIR} ) diff --git a/libbinlogevents/CMakeLists.txt b/libbinlogevents/CMakeLists.txt index 44219c2ba40..be05ff07acc 100644 --- a/libbinlogevents/CMakeLists.txt +++ b/libbinlogevents/CMakeLists.txt @@ -18,7 +18,9 @@ INCLUDE(configure.cmake) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libbinlogevents/include - ${CMAKE_SOURCE_DIR}/libbinlogevents/export + ${CMAKE_SOURCE_DIR}/libbinlogevents/export) + +INCLUDE_DIRECTORIES(SYSTEM # ZLIB_INCLUDE_DIR points to ${CMAKE_SOURCE_DIR}/zlib, # when compiled with MySQL server version (< 5.7). # It is NULL otherwise. diff --git a/libbinlogstandalone/CMakeLists.txt b/libbinlogstandalone/CMakeLists.txt index 47e80c44e78..7f22c46f5af 100644 --- a/libbinlogstandalone/CMakeLists.txt +++ b/libbinlogstandalone/CMakeLists.txt @@ -24,7 +24,7 @@ ADD_DEFINITIONS(-DSTANDALONE_BINLOG) #IF(GTEST_FOUND) # ENABLE_TESTING(TRUE) -# INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}) +# INCLUDE_DIRECTORIES(SYSTEM ${GTEST_INCLUDE_DIRS}) #ENDIF() FIND_PACKAGE(ZLIB REQUIRED) @@ -34,7 +34,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libbinlogevents/include ${CMAKE_CURRENT_BINARY_DIR}/../libbinlogevents/include ${CMAKE_SOURCE_DIR}/libbinlogevents/export - ${CMAKE_CURRENT_BINARY_DIR}/libbinlogevents/export + ${CMAKE_CURRENT_BINARY_DIR}/libbinlogevents/export) + +INCLUDE_DIRECTORIES(SYSTEM # ZLIB_INCLUDE_DIR points to ${CMAKE_SOURCE_DIR}/zlib, # when compiled with MySQL server version (< 5.7). # It is NULL otherwise. diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index efce958dcf0..b2bcd2fcb22 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -19,9 +19,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/strings - ${SSL_INCLUDE_DIRS} - ${SSL_INTERNAL_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR}) + ${SSL_INTERNAL_INCLUDE_DIRS}) + +INCLUDE_DIRECTORIES(SYSTEM + ${ZLIB_INCLUDE_DIR} + ${SSL_INCLUDE_DIRS}) + ADD_DEFINITIONS(${SSL_DEFINES}) SET(CLIENT_API_FUNCTIONS diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index a95cc6ed69b..101f4c173cd 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -27,10 +27,13 @@ INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/libmysqld ${CMAKE_BINARY_DIR}/sql ${CMAKE_SOURCE_DIR}/regex - ${ZLIB_INCLUDE_DIR} - ${SSL_INCLUDE_DIRS} ${SSL_INTERNAL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/sql/backup +) + +INCLUDE_DIRECTORIES(SYSTEM + ${ZLIB_INCLUDE_DIR} + ${SSL_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR} ) @@ -122,7 +125,7 @@ ADD_COMPILE_FLAGS( ../sql/item_geofunc_setops.cc ../sql/item_json_func.cc ../sql/spatial.cc - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) ADD_COMPILE_FLAGS( @@ -147,40 +150,6 @@ IF(WIN32 AND CMAKE_SIZEOF_VOID_P MATCHES 8) ENDFOREACH() ENDIF() -# Boost source has unused local typedefs. -MY_CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" HAVE_NO_UNUSED_TYPEDEFS) -IF(HAVE_NO_UNUSED_TYPEDEFS) - ADD_COMPILE_FLAGS( - ../sql/debug_sync.cc - ../sql/handler.cc - ../sql/geometry_rtree.cc - ../sql/item_geofunc.cc - ../sql/item_geofunc_buffer.cc - ../sql/item_geofunc_internal.cc - ../sql/item_geofunc_relchecks.cc - ../sql/item_geofunc_relchecks_bgwrap.cc - ../sql/item_geofunc_setops.cc - ../sql/item_json_func.cc - ../sql/spatial.cc - COMPILE_FLAGS "-Wno-unused-local-typedefs" - ) -ENDIF() - -# Boost source has misleading indentation -MY_CHECK_CXX_COMPILER_FLAG("-Wmisleading-indentation" - HAVE_MISLEADING_INDENTATION) -IF(HAVE_MISLEADING_INDENTATION) - ADD_COMPILE_FLAGS( - ../sql/geometry_rtree.cc - ../sql/item_geofunc.cc - ../sql/item_geofunc_buffer.cc - ../sql/item_geofunc_internal.cc - ../sql/item_geofunc_relchecks.cc - ../sql/item_geofunc_relchecks_bgwrap.cc - ../sql/item_geofunc_setops.cc - COMPILE_FLAGS "-Wno-misleading-indentation") -ENDIF() - # Handle out-of-source build from source package with possibly broken # bison. Copy bison output to from source to build directory, if not already # there diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index 26bd8c0ad2d..0e852bf9400 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -17,9 +17,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/testclients - ${EDITLINE_INCLUDE_DIR} ) +INCLUDE_DIRECTORIES(SYSTEM + ${EDITLINE_INCLUDE_DIR} + ) ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT) diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 7ed7ef2313d..db750643a88 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -13,7 +13,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys) +INCLUDE_DIRECTORIES(SYSTEM ${ZLIB_INCLUDE_DIR}) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys) SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c errors.c hash.c list.c mf_cache.c mf_dirname.c mf_fn_ext.c diff --git a/mysys_ssl/CMakeLists.txt b/mysys_ssl/CMakeLists.txt index eec1be7127a..2095fff51e5 100644 --- a/mysys_ssl/CMakeLists.txt +++ b/mysys_ssl/CMakeLists.txt @@ -15,7 +15,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys_ssl - ${CMAKE_SOURCE_DIR}/mysys + ${CMAKE_SOURCE_DIR}/mysys) + +INCLUDE_DIRECTORIES(SYSTEM ${SSL_INCLUDE_DIRS}) IF(SSL_DEFINES) diff --git a/plugin/fulltext/CMakeLists.txt b/plugin/fulltext/CMakeLists.txt index a0c88b8ce7e..9dd362a5615 100644 --- a/plugin/fulltext/CMakeLists.txt +++ b/plugin/fulltext/CMakeLists.txt @@ -39,7 +39,9 @@ ENDIF() IF(WITH_MECAB) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include - ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/include) + + INCLUDE_DIRECTORIES(SYSTEM ${MECAB_INCLUDE_DIR}) MYSQL_ADD_PLUGIN(mecab_parser ./mecab_parser/plugin_mecab.cc diff --git a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt index 27c251592e7..942bc623e46 100644 --- a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt +++ b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt @@ -14,12 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Common defines and includes -INCLUDE_DIRECTORIES(${LIBEVENT_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/include +INCLUDE_DIRECTORIES(SYSTEM ${LIBEVENT_INCLUDE_DIR}) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/bld/include ${CMAKE_SOURCE_DIR}/regex - ${CMAKE_SOURCE_DIR}/libevent ${CMAKE_SOURCE_DIR}/include/mysql ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_SOURCE_DIR}/plugin/innodb_memcached/daemon_memcached/include diff --git a/plugin/keyring/CMakeLists.txt b/plugin/keyring/CMakeLists.txt index 5c995814df0..18c65055d0c 100644 --- a/plugin/keyring/CMakeLists.txt +++ b/plugin/keyring/CMakeLists.txt @@ -13,7 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR}) +INCLUDE_DIRECTORIES(SYSTEM ${BOOST_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common) MYSQL_ADD_PLUGIN(keyring_file diff --git a/rapid/plugin/group_replication/CMakeLists.txt b/rapid/plugin/group_replication/CMakeLists.txt index a51780c631e..7a605fc68d8 100644 --- a/rapid/plugin/group_replication/CMakeLists.txt +++ b/rapid/plugin/group_replication/CMakeLists.txt @@ -33,8 +33,6 @@ INCLUDE(rpcgen.cmake) INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/include/ # config.h ${CMAKE_SOURCE_DIR}/libbinlogevents/include/ # byteorder.h - ${SSL_INCLUDE_DIRS} # SSL include dirs - ${LZ4_INCLUDE_DIR} # LZ4 ${XCOM_WINDEPS_INCLUDE_DIRS} # win deps and sun rpc ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/sql_service @@ -45,6 +43,10 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/xdr_gen) +INCLUDE_DIRECTORIES(SYSTEM + ${LZ4_INCLUDE_DIR} # LZ4 + ${SSL_INCLUDE_DIRS}) # SSL include dirs + ### SOURCES ### SET(XCOM_SOURCES diff --git a/rapid/plugin/keyring_udf/CMakeLists.txt b/rapid/plugin/keyring_udf/CMakeLists.txt index 6adbaa9d665..7ae89eaffa5 100644 --- a/rapid/plugin/keyring_udf/CMakeLists.txt +++ b/rapid/plugin/keyring_udf/CMakeLists.txt @@ -13,7 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR}) +INCLUDE_DIRECTORIES(SYSTEM ${BOOST_INCLUDE_DIR}) MYSQL_ADD_PLUGIN(keyring_udf keyring_udf.cc diff --git a/rapid/plugin/x/CMakeLists.txt b/rapid/plugin/x/CMakeLists.txt index 088fc5234d3..d4d45ed5889 100644 --- a/rapid/plugin/x/CMakeLists.txt +++ b/rapid/plugin/x/CMakeLists.txt @@ -29,7 +29,7 @@ MESSAGE(STATUS "Using Boost headers from ${BOOST_INCLUDE_DIR}") SET(XPLUGIN_LOG_PROTOBUF 1 CACHE STRING "Enable logging of protobuf messages") -INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(SYSTEM ${PROTOBUF_INCLUDE_DIRS}) INCLUDE(mysqlx_protobuf.cmake) IF(NOT PROTOBUF_FOUND) @@ -91,6 +91,9 @@ ELSE() ${CMAKE_CURRENT_SOURCE_DIR}/ngs/include ${CMAKE_SOURCE_DIR}/include #temporary ${CMAKE_CURRENT_SOURCE_DIR}/include/mysql + ) + + INCLUDE_DIRECTORIES(SYSTEM ${SSL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) diff --git a/rapid/unittest/gunit/group_replication/CMakeLists.txt b/rapid/unittest/gunit/group_replication/CMakeLists.txt index 7beca11f980..165c68681fc 100644 --- a/rapid/unittest/gunit/group_replication/CMakeLists.txt +++ b/rapid/unittest/gunit/group_replication/CMakeLists.txt @@ -21,12 +21,8 @@ MY_CHECK_CXX_COMPILER_FLAG("-Wno-null-dereference" HAVE_NO_NULL) IF(HAVE_NO_NULL) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-null-dereference") ENDIF() -MY_CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" HAVE_NO_UNUSED_TYPEDEFS) -IF(HAVE_NO_UNUSED_TYPEDEFS) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") -ENDIF() -INCLUDE_DIRECTORIES(${GMOCK_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(SYSTEM ${GMOCK_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/rapid/plugin/group_replication/include) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/rapid/plugin/group_replication/libmysqlgcs/include) diff --git a/rapid/unittest/gunit/xplugin/CMakeLists.txt b/rapid/unittest/gunit/xplugin/CMakeLists.txt index b06e118e22f..e2ee2f45ecd 100644 --- a/rapid/unittest/gunit/xplugin/CMakeLists.txt +++ b/rapid/unittest/gunit/xplugin/CMakeLists.txt @@ -34,10 +34,6 @@ IF(MSVC) ENDIF(MSVC) # Turn off some warning flags when compiling GUnit and proto files. -MY_CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" HAVE_NO_UNUSED_TYPEDEFS) -IF(HAVE_NO_UNUSED_TYPEDEFS) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") -ENDIF() MY_CHECK_CXX_COMPILER_FLAG("-Wunused-variable" HAVE_UNUSED_VARIABLE) IF(HAVE_UNUSED_VARIABLE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable") diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b46c46af95d..2ad192a314d 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -21,9 +21,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql/auth ${CMAKE_SOURCE_DIR}/regex - ${ZLIB_INCLUDE_DIR} - ${SSL_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/sql +) + +INCLUDE_DIRECTORIES(SYSTEM + ${SSL_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} ${LZ4_INCLUDE_DIR} ) @@ -312,7 +315,7 @@ ADD_COMPILE_FLAGS( item_geofunc_setops.cc item_json_func.cc spatial.cc - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) ADD_COMPILE_FLAGS( @@ -326,40 +329,6 @@ IF(WINDOWS_RUNTIME_MD AND CMAKE_SIZEOF_VOID_P MATCHES 8) ADD_COMPILE_FLAGS(item_geofunc_setops.cc COMPILE_FLAGS "/bigobj") ENDIF() -# Boost source has unused local typedefs. -MY_CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" HAVE_NO_UNUSED_TYPEDEFS) -IF(HAVE_NO_UNUSED_TYPEDEFS) - ADD_COMPILE_FLAGS( - debug_sync.cc - handler.cc - geometry_rtree.cc - item_geofunc.cc - item_geofunc_buffer.cc - item_geofunc_internal.cc - item_geofunc_relchecks.cc - item_geofunc_relchecks_bgwrap.cc - item_geofunc_setops.cc - item_json_func.cc - spatial.cc - COMPILE_FLAGS "-Wno-unused-local-typedefs" - ) -ENDIF() - -# Boost source has misleading indentation -MY_CHECK_CXX_COMPILER_FLAG("-Wmisleading-indentation" - HAVE_MISLEADING_INDENTATION) -IF(HAVE_MISLEADING_INDENTATION) - ADD_COMPILE_FLAGS( - geometry_rtree.cc - item_geofunc.cc - item_geofunc_buffer.cc - item_geofunc_internal.cc - item_geofunc_relchecks.cc - item_geofunc_relchecks_bgwrap.cc - item_geofunc_setops.cc - COMPILE_FLAGS "-Wno-misleading-indentation") -ENDIF() - MY_CHECK_CXX_COMPILER_FLAG("-fno-builtin-memcmp" HAVE_NO_BUILTIN_MEMCMP) # See comments in filesort_compare-t.cc about __builtin_memcmp IF(HAVE_NO_BUILTIN_MEMCMP) diff --git a/sql/item_geofunc_relchecks.cc b/sql/item_geofunc_relchecks.cc index ddb072d6e80..781fd286b3d 100644 --- a/sql/item_geofunc_relchecks.cc +++ b/sql/item_geofunc_relchecks.cc @@ -1029,14 +1029,10 @@ template int Item_func_spatial_rel::overlaps_check(Geometry *g1, Geometry *g2, my_bool *pnull_value) { - typedef typename Geom_types::Point Point; - typedef typename Geom_types::Multipoint Multipoint; typedef typename Geom_types::Linestring Linestring; typedef typename Geom_types::Multilinestring Multilinestring; typedef typename Geom_types::Polygon Polygon; typedef typename Geom_types::Multipolygon Multipolygon; - typedef std::set Point_set; - typedef std::vector Point_vector; int result= 0; Geometry::wkbType gt1= g1->get_type(); @@ -1152,11 +1148,6 @@ template int Item_func_spatial_rel::touches_check(Geometry *g1, Geometry *g2, my_bool *pnull_value) { - typedef typename Geom_types::Linestring Linestring; - typedef typename Geom_types::Multilinestring Multilinestring; - typedef typename Geom_types::Polygon Polygon; - typedef typename Geom_types::Multipolygon Multipolygon; - int result= 0; Geometry::wkbType gt1= g1->get_type(); Geometry::wkbType gt2= g2->get_type(); diff --git a/sql/item_geofunc_setops.cc b/sql/item_geofunc_setops.cc index fd31aacf5d2..19e54bde13a 100644 --- a/sql/item_geofunc_setops.cc +++ b/sql/item_geofunc_setops.cc @@ -1882,9 +1882,6 @@ Geometry *Item_func_spatial_operation:: intersection_operation(Geometry *g1, Geometry *g2, String *result) { - typedef typename Geom_types::Coordinate_type Coord_type; - typedef typename Geom_types::Coordinate_system Coordsys; - BG_setop_wrapper wrap(this); Geometry *retgeo= NULL; Geometry::wkbType gt1= g1->get_type(); @@ -2036,9 +2033,6 @@ template Geometry *Item_func_spatial_operation:: union_operation(Geometry *g1, Geometry *g2, String *result) { - typedef typename Geom_types::Coordinate_type Coord_type; - typedef typename Geom_types::Coordinate_system Coordsys; - BG_setop_wrapper wrap(this); Geometry *retgeo= NULL; Geometry::wkbType gt1= g1->get_type(); @@ -2352,7 +2346,6 @@ template Geometry *Item_func_spatial_operation:: symdifference_operation(Geometry *g1, Geometry *g2, String *result) { - typedef typename Geom_types::Coordinate_type Coord_type; typedef typename Geom_types::Coordinate_system Coordsys; BG_setop_wrapper wrap(this); diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake index a90fe67f492..382800b80c0 100644 --- a/storage/innobase/innodb.cmake +++ b/storage/innobase/innodb.cmake @@ -21,7 +21,7 @@ INCLUDE(CheckCSourceRuns) IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY) ADD_DEFINITIONS(-DHAVE_LZ4=1) - INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(SYSTEM ${LZ4_INCLUDE_DIR}) ENDIF() # OS tests diff --git a/storage/ndb/CMakeLists.txt b/storage/ndb/CMakeLists.txt index 87177437264..a4a0a6d8422 100644 --- a/storage/ndb/CMakeLists.txt +++ b/storage/ndb/CMakeLists.txt @@ -182,8 +182,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/include/mgmcommon ${CMAKE_CURRENT_SOURCE_DIR}/include/ndbapi ${CMAKE_CURRENT_SOURCE_DIR}/include/logger - ${CMAKE_CURRENT_BINARY_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR}/include) +INCLUDE_DIRECTORIES(SYSTEM # Util library includes ${ZLIB_INCLUDE_DIR} ${EDITLINE_INCLUDE_DIR}) diff --git a/storage/ndb/memcache/CMakeLists.txt b/storage/ndb/memcache/CMakeLists.txt index c1f34583bee..74c5ff6f24d 100644 --- a/storage/ndb/memcache/CMakeLists.txt +++ b/storage/ndb/memcache/CMakeLists.txt @@ -95,7 +95,7 @@ include_directories(BEFORE ${CACHE_SRC}) include_directories(${NDB_SOURCE_DIR}/src/ndbjtie/mysql) include_directories(${NDB_SOURCE_DIR}/src/ndbapi/) include_directories(${CMAKE_BINARY_DIR}/storage/ndb/memcache/include/) -include_directories(AFTER ${MEMCACHED_INCLUDE_DIR}) +include_directories(AFTER SYSTEM ${MEMCACHED_INCLUDE_DIR}) include_directories(AFTER ${BUNDLED_MEMCACHED}) # Paths to libraries diff --git a/storage/ndb/memcache/extra/memcached/CMakeLists.txt b/storage/ndb/memcache/extra/memcached/CMakeLists.txt index 441ae3930f9..5df4368526c 100644 --- a/storage/ndb/memcache/extra/memcached/CMakeLists.txt +++ b/storage/ndb/memcache/extra/memcached/CMakeLists.txt @@ -19,7 +19,8 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include/memcached ${CMAKE_CURRENT_SOURCE_DIR}/utilities - ${CMAKE_CURRENT_SOURCE_DIR}/daemon + ${CMAKE_CURRENT_SOURCE_DIR}/daemon) +INCLUDE_DIRECTORIES(SYSTEM ${LIBEVENT_INCLUDE_DIR}) IF(${CMAKE_COMPILER_IS_GNUCC}) diff --git a/storage/ndb/nodejs/CMakeLists.txt b/storage/ndb/nodejs/CMakeLists.txt index 763a2e683d3..e600fcf29cb 100644 --- a/storage/ndb/nodejs/CMakeLists.txt +++ b/storage/ndb/nodejs/CMakeLists.txt @@ -41,7 +41,7 @@ set(NODE_VERSION 0.10.4) set(NODE_GYP ${NDB_NODEJS_EXTRAS_PATH}/node-gyp/${NODE_VERSION}) set(NODE_INCLUDES ${NODE_GYP}/src ${NODE_GYP}/deps/uv/include ${NODE_GYP}/deps/v8/include) -include_directories(${NODE_INCLUDES}) +include_directories(SYSTEM ${NODE_INCLUDES}) include_directories(Adapter/impl/common/include) include_directories(Adapter/impl/ndb/include) diff --git a/storage/ndb/src/ndbjtie/CMakeLists.txt b/storage/ndb/src/ndbjtie/CMakeLists.txt index 3eca3a6a31a..8fd8ce349dd 100644 --- a/storage/ndb/src/ndbjtie/CMakeLists.txt +++ b/storage/ndb/src/ndbjtie/CMakeLists.txt @@ -35,7 +35,7 @@ ADD_SUBDIRECTORY(test) IF(HAVE_JDK) - INCLUDE_DIRECTORIES(${JNI_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(SYSTEM ${JNI_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(utils jtie) diff --git a/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt b/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt index a894cb9edf9..809b10452bc 100644 --- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt +++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt @@ -42,8 +42,10 @@ CREATE_JAR(jtie-test-myjapi ${JAVA_SOURCES} IF(HAVE_JDK) + INCLUDE_DIRECTORIES(SYSTEM + ${JNI_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES( - ${JNI_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/utils ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/test/myapi) diff --git a/storage/ndb/src/ndbjtie/test/CMakeLists.txt b/storage/ndb/src/ndbjtie/test/CMakeLists.txt index 41baf256110..024a75cf210 100644 --- a/storage/ndb/src/ndbjtie/test/CMakeLists.txt +++ b/storage/ndb/src/ndbjtie/test/CMakeLists.txt @@ -39,7 +39,9 @@ IF(HAVE_JDK) ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/utils ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie ${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi - ${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi + ${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi) + + INCLUDE_DIRECTORIES( ${JNI_INCLUDE_DIRS}) # enable safety behaviour diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt index 3e4ad1414e9..6869c98c3b7 100644 --- a/storage/perfschema/CMakeLists.txt +++ b/storage/perfschema/CMakeLists.txt @@ -19,7 +19,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/sql ${CMAKE_BINARY_DIR}/sql ${CMAKE_SOURCE_DIR}/regex - ${CMAKE_SOURCE_DIR}/extra/yassl/include + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + +INCLUDE_DIRECTORIES(SYSTEM ${SSL_INCLUDE_DIRS}) ADD_DEFINITIONS(-DMYSQL_SERVER) diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt index ef01904de37..02e65d0ce63 100644 --- a/storage/perfschema/unittest/CMakeLists.txt +++ b/storage/perfschema/unittest/CMakeLists.txt @@ -17,10 +17,12 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/mysql ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/sql - ${SSL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/unittest/mytap ${CMAKE_SOURCE_DIR}/storage/perfschema) +INCLUDE_DIRECTORIES(SYSTEM + ${SSL_INCLUDE_DIRS}) + ADD_DEFINITIONS(-DMYSQL_SERVER ${SSL_DEFINES}) ADD_CONVENIENCE_LIBRARY(pfs_server_stubs pfs_server_stubs.cc) diff --git a/unittest/gunit/CMakeLists.txt b/unittest/gunit/CMakeLists.txt index 9a015471d83..054113dc869 100644 --- a/unittest/gunit/CMakeLists.txt +++ b/unittest/gunit/CMakeLists.txt @@ -199,10 +199,6 @@ INCLUDE_DIRECTORIES( ) # Turn off some warning flags when compiling GUnit -MY_CHECK_CXX_COMPILER_FLAG("-Wno-unused-local-typedefs" HAVE_NO_UNUSED_TYPEDEFS) -IF(HAVE_NO_UNUSED_TYPEDEFS) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") -ENDIF() MY_CHECK_CXX_COMPILER_FLAG("-Wno-missing-field-initializers" HAVE_NO_MISSING_FIELD_INITIALIZERS) IF(HAVE_NO_MISSING_FIELD_INITIALIZERS) @@ -223,13 +219,16 @@ ENDIF() INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libbinlogevents/include - ${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql/auth ${CMAKE_SOURCE_DIR}/storage/example ) +INCLUDE_DIRECTORIES(SYSTEM + ${ZLIB_INCLUDE_DIR} +) + # main-wrapper libraries (with tap-compatible option). ADD_LIBRARY(gunit_small STATIC fake_costmodel.cc @@ -385,7 +384,7 @@ IF (MERGE_UNITTESTS) ENDIF() ADD_COMPILE_FLAGS( ${MERGE_SMALL_TESTS} - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) @@ -460,11 +459,11 @@ ENDIF(MERGE_UNITTESTS) ENDIF() ADD_COMPILE_FLAGS( bounded_queue-t.cc - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) ADD_COMPILE_FLAGS( pump_object_filter-t.cc - COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -I${BOOST_INCLUDE_DIR} + COMPILE_FLAGS -I${BOOST_PATCHES_DIR} -isystem ${BOOST_INCLUDE_DIR} ) FOREACH(test ${SERVER_TESTS}) diff --git a/unittest/gunit/innodb/CMakeLists.txt b/unittest/gunit/innodb/CMakeLists.txt index 0cdd0ad1a09..27bee6c1d59 100644 --- a/unittest/gunit/innodb/CMakeLists.txt +++ b/unittest/gunit/innodb/CMakeLists.txt @@ -13,8 +13,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES( +INCLUDE_DIRECTORIES(SYSTEM ${GTEST_INCLUDE_DIRS} +) + +INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql/auth diff --git a/unittest/gunit/keyring/CMakeLists.txt b/unittest/gunit/keyring/CMakeLists.txt index 74a9d03384f..87e6c1d8ef7 100644 --- a/unittest/gunit/keyring/CMakeLists.txt +++ b/unittest/gunit/keyring/CMakeLists.txt @@ -18,10 +18,10 @@ IF(NOT GMOCK_FOUND) RETURN() ENDIF() -INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${BOOST_PATCHES_DIR}) +INCLUDE_DIRECTORIES(SYSTEM ${BOOST_INCLUDE_DIR}) INCLUDE_DIRECTORIES( - ${GMOCK_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/plugin/keyring @@ -29,6 +29,10 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/unittest/gunit ) +INCLUDE_DIRECTORIES(SYSTEM + ${GMOCK_INCLUDE_DIRS} +) + SET(TESTS keyring-api keys_container diff --git a/unittest/gunit/yassl/CMakeLists.txt b/unittest/gunit/yassl/CMakeLists.txt index 97bca690cb7..fdf65d52c93 100644 --- a/unittest/gunit/yassl/CMakeLists.txt +++ b/unittest/gunit/yassl/CMakeLists.txt @@ -13,8 +13,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES( +INCLUDE_DIRECTORIES(SYSTEM ${GTEST_INCLUDE_DIRS} +) + +INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/unittest/gunit ${CMAKE_SOURCE_DIR}/extra/yassl/include diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt index 903b91709dc..5f58f9a587d 100644 --- a/vio/CMakeLists.txt +++ b/vio/CMakeLists.txt @@ -13,8 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include -${SSL_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(SYSTEM ${SSL_INCLUDE_DIRS}) ADD_DEFINITIONS(${SSL_DEFINES}) SET(VIO_SOURCES