From cc6bcefc6a686a0caea5ea7c4258f3070c4e2983 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Sep 2026 09:59:52 -0400 Subject: [PATCH] Apple: Restore detection of platform-specific GNU Fortran flags Detection of `-isysroot` was broken by commit a1b5c0da87 (Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL, 2026-05-05, v4.4.0-rc1~209^2~1) because `gfortran -v --help` returns non-zero. Fixes: #28111 --- Modules/Platform/Apple-GNU.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake index 1852c6e752..5ddb08b6c0 100644 --- a/Modules/Platform/Apple-GNU.cmake +++ b/Modules/Platform/Apple-GNU.cmake @@ -31,9 +31,9 @@ macro(cmake_gnu_set_sysroot_flag lang) COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help" OUTPUT_VARIABLE _gcc_help ERROR_VARIABLE _gcc_help - RESULT_VARIABLE _gcc_result + RESULT_VARIABLE _gcc_result # may be non-zero ) - if(_gcc_result EQUAL 0 AND "${_gcc_help}" MATCHES "isysroot") + if("${_gcc_help}" MATCHES "isysroot") message(CHECK_PASS "yes") set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot") else() @@ -52,9 +52,9 @@ macro(cmake_gnu_set_osx_deployment_target_flag lang) COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help" OUTPUT_VARIABLE _gcc_help ERROR_VARIABLE _gcc_help - RESULT_VARIABLE _gcc_result + RESULT_VARIABLE _gcc_result # may be non-zero ) - if(_gcc_result EQUAL 0 AND "${_gcc_help}" MATCHES "macosx-version-min") + if("${_gcc_help}" MATCHES "macosx-version-min") message(CHECK_PASS "yes") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=") else()