This commit is contained in:
2022-10-07 08:03:03 +03:00
parent 432a1a85e6
commit f0203307c4
8 changed files with 14 additions and 28 deletions

View File

@@ -10,16 +10,19 @@ macro(check_enable_cxx_compiler_flag flag)
set(multiValueArgs)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(cmake_required_quiet TRUE)
set(CMAKE_REQUIRED_QUIET TRUE)
check_cxx_compiler_flag("${flag}" check_cxx_flag)
unset(cmake_required_quiet)
unset(CMAKE_REQUIRED_QUIET)
if(check_cxx_flag)
myx_message_notice("'${flag}': flag is supported.")
if(ARG_TARGET)
target_compile_options(${ARG_TARGET} PUBLIC ${flag})
else()
add_compile_options(${flag})
endif()
else()
myx_message_status("'${flag}': flag is NOT supported.")
endif()
unset(check_cxx_flag CACHE)