summaryrefslogtreecommitdiff
path: root/Modules/CheckSourceRuns.cmake
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.gitlab.kitware.com>2020-10-15 08:46:03 -0400
committerBrad King <brad.king@kitware.com>2020-10-15 09:33:59 -0400
commit1e519df0259677df67b5e7d21e1f189d655ddbd3 (patch)
tree3633cbfd48f5db5c1c3d0191cc3fff240e46e0ae /Modules/CheckSourceRuns.cmake
parentb1d9a25f35a22f41b2c1b87725f091936711a28c (diff)
downloadcmake-1e519df0259677df67b5e7d21e1f189d655ddbd3.tar.gz
CheckSource{Runs,Compiles}: Fix default Fortran source extension
In commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a source runs, 2020-09-14, v3.19.0-rc1~118^2), the default Fortran source file extension was accidentally changed from `.F90` to `.F`. Fix that. In commit 10ae907de0 (CheckSoureCompiles: Add a unified way to check if a source compiles, 2020-09-14, v3.19.0-rc1~118^2~1), the default Fortran source extension was correctly preserved as `.F`, but `.F90` is a better default both for consistency and modern usage. Use that for direct calls to the `check_source_compiles` macro. Update our original `check_fortran_source_compiles` implementation to use `.F` by default as it did before. Fixes: #21307
Diffstat (limited to 'Modules/CheckSourceRuns.cmake')
-rw-r--r--Modules/CheckSourceRuns.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake
index 20f3e1e09f..033793dfb8 100644
--- a/Modules/CheckSourceRuns.cmake
+++ b/Modules/CheckSourceRuns.cmake
@@ -92,7 +92,7 @@ function(CHECK_SOURCE_RUNS _lang _source _var)
set(_lang_ext "cu")
elseif(_lang STREQUAL Fortran)
set(_lang_textual "Fortran")
- set(_lang_ext "F")
+ set(_lang_ext "F90")
elseif(_lang STREQUAL OBJC)
set(_lang_textual "Objective-C")
set(_lang_ext "m")
@@ -114,10 +114,13 @@ function(CHECK_SOURCE_RUNS _lang _source _var)
set(_SRC_EXT)
set(_key)
foreach(arg ${ARGN})
- if("${arg}" MATCHES "^(SRC_EXT)$")
+ if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
set(_key "${arg}")
- elseif(_key)
- list(APPEND _${_key} "${arg}")
+ elseif(_key STREQUAL "FAIL_REGEX")
+ list(APPEND _FAIL_REGEX "${arg}")
+ elseif(_key STREQUAL "SRC_EXT")
+ set(_SRC_EXT "${arg}")
+ set(_key "")
else()
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
endif()