mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 10:36:42 +00:00

When OpenMP is compiled as a part runtimes for multiple targets, openmp is compiled under build/runtimes/runtimes-arch-unknown-linux-gnu-bins directory. Old implementation treats this directory name as errors. This patch adds a guard like "[Uu]known[^-]". Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D114346
30 lines
1.2 KiB
CMake
30 lines
1.2 KiB
CMake
#
|
|
#//===----------------------------------------------------------------------===//
|
|
#//
|
|
#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
#// See https://llvm.org/LICENSE.txt for license information.
|
|
#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
#//
|
|
#//===----------------------------------------------------------------------===//
|
|
#
|
|
|
|
# Checking a fortran compiler flag
|
|
# There is no real trivial way to do this in CMake, so we implement it here
|
|
# this will have ${boolean} = TRUE if the flag succeeds, otherwise false.
|
|
function(libomp_check_fortran_flag flag boolean)
|
|
if(NOT DEFINED "${boolean}")
|
|
set(retval TRUE)
|
|
set(fortran_source
|
|
" program hello
|
|
print *, \"Hello World!\"
|
|
end program hello")
|
|
|
|
# Compiling as a part of runtimes introduces ARCH-unknown-linux-gnu as a
|
|
# part of a working directory. So adding a guard for unknown.
|
|
set(failed_regexes "[Ee]rror;[Uu]nknown[^-];[Ss]kipping")
|
|
include(CheckFortranSourceCompiles)
|
|
check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")
|
|
set(${boolean} ${${boolean}} PARENT_SCOPE)
|
|
endif()
|
|
endfunction()
|