function(add_compilation_flags name flags_list)
    message(STATUS "Adding compilation flags to ${name}")
    foreach (flag ${flags_list})
        check_cxx_compiler_flag(${flag} COMPILER_OPT_SUPPORTED${flag})
        if (COMPILER_OPT_SUPPORTED${flag})
            # message(STATUS "Adding ${flag} flag to ${name}")
            target_compile_options(${name} PUBLIC ${flag})
        else ()
            message(WARNING "The compiler does not support ${flag} flag")
        endif ()
    endforeach ()
endfunction(add_compilation_flags)
