@@ -47,20 +47,18 @@ include(CheckCCompilerFlag)
4747include (CheckCXXCompilerFlag)
4848
4949## adds a compiler flag if the compiler supports it
50- macro (set_cflags_if_supported )
50+ macro (prepend_cflags_if_supported )
5151 foreach (flag ${ARGN} )
5252 MY_CHECK_AND_SET_COMPILER_FLAG(${flag} )
5353 endforeach (flag)
54- endmacro (set_cflags_if_supported )
54+ endmacro (prepend_cflags_if_supported )
5555
5656if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
5757 set (OPTIONAL_CFLAGS "${OPTIONAL_CFLAGS} -Wmissing-format-attribute" )
5858endif ()
5959
6060## disable some warnings
61- ## missing-format-attribute causes warnings in some MySQL include files
62- ## if the library is built as a part of TokuDB MySQL storage engine
63- set_cflags_if_supported(
61+ prepend_cflags_if_supported(
6462 -Wno-missing-field-initializers
6563 -Wstrict-null-sentinel
6664 -Winit-self
@@ -77,7 +75,6 @@ set_cflags_if_supported(
7775 -fno-exceptions
7876 -Wno-error=nonnull-compare
7977 )
80- ## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
8178
8279if (CMAKE_CXX_FLAGS MATCHES -fno-implicit-templates)
8380 # must append this because mysql sets -fno-implicit-templates and we need to override it
@@ -89,24 +86,18 @@ endif()
8986
9087## Clang has stricter POD checks. So, only enable this warning on our other builds (Linux + GCC)
9188if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
92- set_cflags_if_supported (
89+ prepend_cflags_if_supported (
9390 -Wpacked
9491 )
9592endif ()
9693
9794option (PROFILING "Allow profiling and debug" ON )
9895if (PROFILING)
99- set_cflags_if_supported (
96+ prepend_cflags_if_supported (
10097 -fno-omit-frame-pointer
10198 )
10299endif ()
103100
104- ## this hits with optimized builds somewhere in ftleaf_split, we don't
105- ## know why but we don't think it's a big deal
106- set_cflags_if_supported(
107- -Wno-error=strict-overflow
108- )
109-
110101# new flag sets in MySQL 8.0 seem to explicitly disable this
111102set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
112103
@@ -144,7 +135,7 @@ else ()
144135endif ()
145136
146137## set warnings
147- set_cflags_if_supported (
138+ prepend_cflags_if_supported (
148139 -Wextra
149140 -Wbad-function-cast
150141 -Wno-missing-noreturn
@@ -167,7 +158,7 @@ set_cflags_if_supported(
167158
168159if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang)
169160 # Disabling -Wcast-align with clang. TODO: fix casting and re-enable it, someday.
170- set_cflags_if_supported (-Wcast-align)
161+ prepend_cflags_if_supported (-Wcast-align)
171162endif ()
172163
173164## never want these
0 commit comments