3.19.0-rc1 regression: check_fortran_source_runs / check_source_runs(Fortran ...)
- Platform: Windows
- Release: 3.19.0-rc1
- Compilers: GCC 10.2.0, Intel oneAPI
- Generator: Ninja or MinGW Makefiles
I added check_fortran_source_runs to CMake, and it works fine until this release candidate. The recent welcome enhancements to CheckSourceRuns seem to have broken check_fortran_source_runs.
MWE, resulting in Fatal Error:
cmake_minimum_required(VERSION 3.14)
project(reg Fortran)
include(CheckFortranSourceRuns)
check_fortran_source_runs("program hello; end program" _ok)
if(NOT _ok)
message(FATAL_ERROR)
endif()
The same thing happens if I use check_source_runs(Fortran ...)
CMakeError.log
Performing Fortran SOURCE FILE Test _ok failed with the following compile output:
Change Dir: C:/temp/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/msys64/mingw64/bin/ninja.exe cmTC_fc31a && [1/4] Building Fortran preprocessed CMakeFiles/cmTC_fc31a.dir/src.F-pp.f
[2/4] Generating Fortran dyndep file CMakeFiles/cmTC_fc31a.dir/Fortran.dd
[3/4] Building Fortran object CMakeFiles/cmTC_fc31a.dir/src.F.obj
FAILED: CMakeFiles/cmTC_fc31a.dir/src.F.obj
C:\msys64\mingw64\bin\gfortran.exe -I. -fpreprocessed -c CMakeFiles/cmTC_fc31a.dir/src.F-pp.f -o CMakeFiles/cmTC_fc31a.dir/src.F.obj
src.F:1:2:
1 | program hello; end program
| 1
Error: Non-numeric character in statement label at (1)
ninja: build stopped: subcommand failed.
...and run output:
Return value: 1
Source file was:
program hello; end program