Use compiler ID check for /guard:cf and /GL flags on MSVC by KseniyaTikhomirova · Pull Request #374 · oneapi-src/level-zero
Conversation
check_cxx_compiler_flag is not fully sufficient here. "A successful result only indicates that the compiler did not report an error when given the flag. Whether the flag has any effect, or the intended one, is outside the scope of this module."
clang-cl reports these flags as supported but they are not used during compilation stage and command line without linking ( "-c" ) reports warning that the flag is unused. This warning is converted to error with werror enabled.
This commit reverts previous changes and moves troublesome flags under the explicit check of compiler name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters