summaryrefslogtreecommitdiff
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-21 10:38:16 -0500
committerBrad King <brad.king@kitware.com>2020-01-21 10:41:20 -0500
commit8217a26d29f366e85eafb07711c1fbd449fe3588 (patch)
tree483a95ff96eb89620d1d378455472bf2eca853c3 /Modules/FindMPI.cmake
parent320ad3f31f7184e82e6fe38afa69d0066d796788 (diff)
downloadcmake-8217a26d29f366e85eafb07711c1fbd449fe3588.tar.gz
FindMPI: Fix regression when compiling with MPI wrappers
The change in commit 5861c6d450 (FindMPI: Preserve include order when extracting component directories, 2019-12-19) converted a CMake-language function to a macro. However, it contains a `return()` call that now applies in the caller's scope, which is in correct. The `return()` is meant to skip work when using a MPI compiler wrapper as the main compiler. Move that condition to the call site instead. Fixes: #20234
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index d1257c945b..9eaf8b4c67 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1060,9 +1060,6 @@ macro(_MPI_assemble_libraries LANG)
endmacro()
macro(_MPI_split_include_dirs LANG)
- if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
- return()
- endif()
# Backwards compatibility: Search INCLUDE_PATH if given.
if(MPI_${LANG}_INCLUDE_PATH)
list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}")
@@ -1475,7 +1472,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endif()
- _MPI_split_include_dirs(${LANG})
+ if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ _MPI_split_include_dirs(${LANG})
+ endif()
_MPI_assemble_libraries(${LANG})
_MPI_adjust_compile_definitions(${LANG})