1
0
Эх сурвалжийг харах

FindMPI: Recoginze -f flags from mpicc (#10771)

Parse compiler flags like "-fmessage-length=0 -fstack-protector
-funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing" from
the output of "mpicc -show".  We already handle preprocessor definition
arguments like -DUSE_STDARG.  Honor '-f' flags too.
Brad King 15 жил өмнө
parent
commit
a56969f3d3
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      Modules/FindMPI.cmake

+ 1 - 1
Modules/FindMPI.cmake

@@ -188,7 +188,7 @@ if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
   # the cache, and we don't want to override those settings.
 elseif (MPI_COMPILE_CMDLINE)
   # Extract compile flags from the compile command line.
-  string(REGEX MATCHALL "(^| )-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
+  string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
   set(MPI_COMPILE_FLAGS_WORK)
   foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
     if (MPI_COMPILE_FLAGS_WORK)