File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,25 @@ IF(DEFINED TOKUDB_CHECK_JEMALLOC)
31
31
ADD_DEFINITIONS ("-DTOKUDB_CHECK_JEMALLOC=${TOKUDB_CHECK_JEMALLOC} " )
32
32
ENDIF ()
33
33
34
+ ## adds a compiler flag if the compiler supports it
35
+ include (CheckCCompilerFlag )
36
+ include (CheckCXXCompilerFlag )
37
+
38
+ macro (set_cflags_if_supported )
39
+ foreach (flag ${ARGN} )
40
+ check_c_compiler_flag (${flag} HAVE_C_${flag} )
41
+ if (HAVE_C_${flag} )
42
+ set (CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS} " )
43
+ endif ()
44
+ check_cxx_compiler_flag (${flag} HAVE_CXX_${flag} )
45
+ if (HAVE_CXX_${flag} )
46
+ set (CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS} " )
47
+ endif ()
48
+ endforeach (flag )
49
+ endmacro (set_cflags_if_supported )
50
+
51
+ set_cflags_if_supported (-Wno-missing-field-initializers )
52
+
34
53
ADD_SUBDIRECTORY (ft-index )
35
54
36
55
# TODO: clean up includes in ft-index
You can’t perform that action at this time.
0 commit comments