diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-08-19 17:09:39 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-08-19 17:09:39 (GMT) |
commit | 2b2a6a7170c2253c1f97647a03c190aa906e194a (patch) | |
tree | f12c891633a5d16d457d08160b110e5490f15137 | |
parent | 30dd9b33a048ec76fd48665f3793cf282cd75f12 (diff) | |
download | CMake-2b2a6a7170c2253c1f97647a03c190aa906e194a.zip CMake-2b2a6a7170c2253c1f97647a03c190aa906e194a.tar.gz CMake-2b2a6a7170c2253c1f97647a03c190aa906e194a.tar.bz2 |
FindMPI: do not detect `-framework` as a compile flag
MPICH 3.4.2 now reports `-framework OpenCL` as one of its compilation
flag. The compile flag extraction is seeing it as a generic `-f` flag
and misses its argument. This ends up with a compile option of
`-framework` which eats the next flag (and may be very important).
It does not seem that passing `-framework` as a link flag is necessary
at this time, so that is being actively ignored for now.
Fixes: #22555
-rw-r--r-- | Modules/FindMPI.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index c48decb..d8f0334 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -624,7 +624,8 @@ function (_MPI_interrogate_compiler LANG) # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore # produce inconsistent results with the regularly flags. # Similarly, aliasing flags do not belong into our flag array. - if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f((no-|)(stack-protector|strict-aliasing)|PI[CE]|pi[ce])") + # Also strip out `-framework` flags. + if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f((no-|)(stack-protector|strict-aliasing)|PI[CE]|pi[ce]|ramework)") list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") endif() endforeach() |