mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx-cmake: add remove_flag
and remove_compile_flag
macros.
This commit is contained in:
parent
eb532b8907
commit
57978b0f7f
@ -36,6 +36,23 @@ macro(add_compile_flags languages)
|
||||
unset(_flags)
|
||||
endmacro(add_compile_flags)
|
||||
|
||||
macro(remove_flag varname flag)
|
||||
string(REGEX REPLACE "^(.*)( ${flag} )(.*)$" "\\1 \\3" ${varname} ${${varname}})
|
||||
string(REGEX REPLACE "^((.+ )*)(${flag})(( .+)*)$" "\\1\\4" ${varname} ${${varname}})
|
||||
endmacro(remove_flag)
|
||||
|
||||
macro(remove_compile_flag languages flag)
|
||||
foreach(_lang ${languages})
|
||||
if(CMAKE_CXX_COMPILER_LOADED AND _lang STREQUAL "CXX")
|
||||
remove_flag(${_lang}_FLAGS ${flag})
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_LOADED AND _lang STREQUAL "C")
|
||||
remove_flag(${_lang}_FLAGS ${flag})
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_lang)
|
||||
endmacro(remove_compile_flag)
|
||||
|
||||
macro(set_source_files_compile_flags)
|
||||
foreach(file ${ARGN})
|
||||
get_filename_component(_file_ext ${file} EXT)
|
||||
|
Loading…
Reference in New Issue
Block a user