CheckCompilerFlag: Add support for LLVMFlang

Make checks like

    check_compiler_flag(Fortran "-Wall" HAVE_WALL)

work with LLVMFlang.
This commit is contained in:
scivision
2024-08-23 12:04:51 -04:00
committed by Brad King
parent 1d6535c881
commit e8fd9ba8e8

View File

@@ -27,7 +27,8 @@ macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
FAIL_REGEX "argument unused during compilation: .*") # Clang
elseif("${_LANG}" STREQUAL "Fortran")
set(${_SRC} " program test\n stop\n end program")
set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
set(${_PATTERNS} FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran"
FAIL_REGEX "argument unused during compilation: .*") # LLVMFlang
elseif("${_LANG}" STREQUAL "HIP")
set(${_SRC} "__host__ int main() { return 0; }")
set(${_PATTERNS} FAIL_REGEX "argument unused during compilation: .*") # Clang