Skip to content
Snippets Groups Projects
Commit 4063acee authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

DuneMPI: append flags to `COMPILE_OPTIONS` instead of `COMPILE_FLAGS`

`COMPILE_FLAGS` is a string, but `set_property(... APPEND ...)`
appends to a list.  If the list of compile flags is not empty this
results in a superfluous semicolon in the compile flags which will
break the compiler invocation.

For example, when `MPI_DUNE_COMPILE_FLAGS=-lpthread`, calling
`add_dune_mpi_flags` twice for the same target would result in the
compiler command containing `-lpthread;-lpthread`.

This patch makes use of the `COMPILE_OPTIONS` property instead which
is a list.
parent 7b2d907b
No related branches found
No related tags found
1 merge request!499DuneMPI: append flags to `COMPILE_OPTIONS` instead of `COMPILE_FLAGS`
...@@ -58,7 +58,7 @@ function(add_dune_mpi_flags) ...@@ -58,7 +58,7 @@ function(add_dune_mpi_flags)
set(_prefix TARGET) set(_prefix TARGET)
endif() endif()
if(MPI_C_FOUND) if(MPI_C_FOUND)
set_property(${_prefix} ${ADD_MPI_UNPARSED_ARGUMENTS} APPEND PROPERTY COMPILE_FLAGS ${MPI_DUNE_COMPILE_FLAGS}) set_property(${_prefix} ${ADD_MPI_UNPARSED_ARGUMENTS} APPEND PROPERTY COMPILE_OPTIONS ${MPI_DUNE_COMPILE_FLAGS})
set_property(${_prefix} ${ADD_MPI_UNPARSED_ARGUMENTS} APPEND PROPERTY COMPILE_DEFINITIONS ENABLE_MPI=1 set_property(${_prefix} ${ADD_MPI_UNPARSED_ARGUMENTS} APPEND PROPERTY COMPILE_DEFINITIONS ENABLE_MPI=1
MPICH_SKIP_MPICXX MPIPP_H) MPICH_SKIP_MPICXX MPIPP_H)
if(NOT (ADD_MPI_SOURCE_ONLY OR ADD_MPI_OBJECT)) if(NOT (ADD_MPI_SOURCE_ONLY OR ADD_MPI_OBJECT))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment