• Sergei Golubchik's avatar
    correctly detect unsupported compiler flags · 0c25e58d
    Sergei Golubchik authored
    in gcc `-Wno-unsupported-something` will not be an error or even a warning,
    so cmake will think the flag is supported. But if there's any other
    warning during compilation, for any reason, unknown option will
    be a warning too. Or an error when -Werror, even if that "other warning"
    would not be an error on itself.
    
    So we need to detect whether `-Wno-unsupported-something` is *really*
    supported. Luckily, `-Wunsupported-something` will always fail with an
    error.
    
    So, whenever there's a need to detect if -Wno-something is supported,
    test -Wsomething instead.
    0c25e58d
check_compiler_flag.cmake 2.06 KB