must link with -lgfortran when using flang

This commit is contained in:
Axel Kohlmeyer
2022-09-12 17:02:06 -04:00
parent 60e172c18c
commit 7a97b25c8d

View File

@ -23,6 +23,10 @@ if(CMAKE_Fortran_COMPILER)
endif()
else()
add_library(fmpi_stubs STATIC mpi_stubs.f90)
get_filename_component(_tmp_fc ${CMAKE_Fortran_COMPILER} NAME)
if (_tmp_fc STREQUAL "flang")
target_link_libraries(fmpi_stubs PUBLIC gfortran)
endif()
add_library(MPI::MPI_Fortran ALIAS fmpi_stubs)
endif()