2 #//===----------------------------------------------------------------------===//
4 #// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 #// See https://llvm.org/LICENSE.txt for license information.
6 #// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #//===----------------------------------------------------------------------===//
11 # Checking a fortran compiler flag
12 # There is no real trivial way to do this in CMake, so we implement it here
13 # this will have ${boolean} = TRUE if the flag succeeds, otherwise false.
14 function(libomp_check_fortran_flag flag boolean)
15 if(NOT DEFINED "${boolean}")
19 print *, \"Hello World!\"
22 # Compiling as a part of runtimes introduces ARCH-unknown-linux-gnu as a
23 # part of a working directory. So adding a guard for unknown.
24 set(failed_regexes "[Ee]rror;[Uu]nknown[^-];[Ss]kipping")
25 include(CheckFortranSourceCompiles)
26 check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")
27 set(${boolean} ${${boolean}} PARENT_SCOPE)