• Robert Maynard's avatar
    FindMPI: make sure computed link flags are not de-duplicated · cf04da7e
    Robert Maynard authored
    In commit f7eaa342 (FindMPI: Store imported target link flags as a
    list instead of a string, 2019-06-14, v3.15.0-rc2~2^2) we used
    `separate_arguments` to parse the extracted link flags and add them to
    `INTERFACE_LINK_LIBRARIES`.  That property is not meant for link flags
    and CMake may de-duplicate them.  This is particularly problematic for
    flags like `-Wl,-rpath -Wl,/path1 -Wl,-rpath -Wl,/path2`.
    
    In commit 39c572c9 (FindMPI: Updated to use INTERFACE_LINK_OPTIONS,
    2019-06-24) we moved the parsed flags over to `INTERFACE_LINK_OPTIONS`,
    but that may still perform de-duplication.  Avoid the parsing and
    de-duplication of flags by passing the original string via `SHELL:`
    instead.
    
    Fixes: #19516
    cf04da7e
FindMPI.cmake 85.7 KB