Skip to content

Commit e89205f

Browse files
authored
BuildPDAF: Safe adding of PDAF_MPI include directory (#78)
avoiding isolated `-I`
1 parent eb3e5e2 commit e89205f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmake/BuildPDAF.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ list(JOIN PDAF_DOUBLEPRECISION " " PDAF_DOUBLEPRECISION)
220220

221221
# Set PDAF_MPI_INC for Makefile header
222222
# ----------------------------------
223-
list(APPEND PDAF_MPI_INC "-I${MPICH_Fortran_INCLUDEDIR}")
223+
if(DEFINED MPICH_Fortran_INCLUDEDIR AND NOT MPICH_Fortran_INCLUDEDIR STREQUAL "")
224+
list(APPEND PDAF_MPI_INC "-I${MPICH_Fortran_INCLUDEDIR}")
225+
endif()
224226

225227
# Join list
226228
list(JOIN PDAF_MPI_INC " " PDAF_MPI_INC)

0 commit comments

Comments
 (0)