Skip to content

Commit 3a030fa

Browse files
committed
#257 disable missing field initializer warning
1 parent ca032f3 commit 3a030fa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

storage/tokudb/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ IF(DEFINED TOKUDB_CHECK_JEMALLOC)
3131
ADD_DEFINITIONS("-DTOKUDB_CHECK_JEMALLOC=${TOKUDB_CHECK_JEMALLOC}")
3232
ENDIF()
3333

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+
3453
ADD_SUBDIRECTORY(ft-index)
3554

3655
INCLUDE_DIRECTORIES(ft-index)

0 commit comments

Comments
 (0)