mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
DB-783 append -Wvla to compiler flags to allow variable length arrays to be used in tokudb
This commit is contained in:
parent
612d7a87a0
commit
59f2e81769
1 changed files with 20 additions and 4 deletions
|
@ -46,18 +46,34 @@ include(CheckCXXCompilerFlag)
|
|||
|
||||
macro(set_cflags_if_supported)
|
||||
foreach(flag ${ARGN})
|
||||
check_c_compiler_flag(${flag} HAVE_C_${flag})
|
||||
if (HAVE_C_${flag})
|
||||
string(REGEX REPLACE "-" "_" temp_flag ${flag})
|
||||
check_c_compiler_flag(${flag} HAVE_C_${temp_flag})
|
||||
if (HAVE_C_${temp_flag})
|
||||
set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
|
||||
endif ()
|
||||
check_cxx_compiler_flag(${flag} HAVE_CXX_${flag})
|
||||
if (HAVE_CXX_${flag})
|
||||
check_cxx_compiler_flag(${flag} HAVE_CXX_${temp_flag})
|
||||
if (HAVE_CXX_${temp_flag})
|
||||
set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
|
||||
endif ()
|
||||
endforeach(flag)
|
||||
endmacro(set_cflags_if_supported)
|
||||
|
||||
macro(append_cflags_if_supported)
|
||||
foreach(flag ${ARGN})
|
||||
string(REGEX REPLACE "-" "_" temp_flag ${flag})
|
||||
check_c_compiler_flag(${flag} HAVE_C_${temp_flag})
|
||||
if (HAVE_C_${temp_flag})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||
endif ()
|
||||
check_cxx_compiler_flag(${flag} HAVE_CXX_${temp_flag})
|
||||
if (HAVE_CXX_${temp_flag})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endif ()
|
||||
endforeach(flag)
|
||||
endmacro(append_cflags_if_supported)
|
||||
|
||||
set_cflags_if_supported(-Wno-missing-field-initializers)
|
||||
append_cflags_if_supported(-Wno-vla)
|
||||
|
||||
ADD_SUBDIRECTORY(ft-index)
|
||||
|
||||
|
|
Loading…
Reference in a new issue