CMakeAddFortranSubdirectory: Fail when the MinGW configure or build fails

The configure and build wrapper scripts ignored the result of
`execute_process`, so a failure in the MinGW project (e.g. a gfortran
compilation error) was not reported and the parent build continued,
failing later at link time or not at all.

Closes: #28240
This commit is contained in:
Julien Marrec authored and Brad King committed 2026-11-02 11:20:52 -05:00
1 parent bf00790cfb
commit 5b5037f125
2 files changed
+5 -2

No files matched your search

@@ -8,4 +8,6 @@ foreach(byproduct IN LISTS byproducts)
set(clean_first --clean-first)
endif()
endforeach()
execute_process(COMMAND "@CMAKE_COMMAND@" --build . ${clean_first})
execute_process(
COMMAND "@CMAKE_COMMAND@" --build . ${clean_first}
COMMAND_ERROR_IS_FATAL ANY)
@@ -6,4 +6,5 @@ execute_process(
-DBUILD_SHARED_LIBS=ON
-DCMAKE_GNUtoMS=ON
${CMAKE_COMMAND_LINE}
"@source_dir@")
"@source_dir@"
COMMAND_ERROR_IS_FATAL ANY)