-
Notifications
You must be signed in to change notification settings - Fork 333
/
Copy pathFortran.cmake
33 lines (29 loc) · 1.13 KB
/
Fortran.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##===- Fortran.cmake ----------------------------------------------------===##
#
# Fortran-specific helper functions to build benchmarks and the
# corresponding .test files
#
##===--------------------------------------------------------------------===##
# The Ninja generator supports robust scanning for modules that are
# needed by some Fortran tests. Because Ninja does a full
# preprocessing pass on Fortran files, it is able to detect module
# dependencies that are dependent on preprocessing.
# For example,
# #ifdef FOO
# USE MODULE_A
# #else
# USE MODULE_B
# #endif
# This is support by Ninja, but not the Unix Makefiles generator.
# More details here:
# https://gitlab.kitware.com/cmake/cmake/-/issues/16590"
function(ninja_required)
if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
message(SEND_ERROR
"This test is NOT supported by CMAKE_GENERATOR = ${CMAKE_GENERATOR}.\n"
"Please use use Ninja 1.10 or later by adding -G \"Ninja\" to cmake invocation.\n")
endif()
endfunction()
# standard CMake Utility Modules specific to Fortran
# https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html
include(CheckFortranCompilerFlag)