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

Pass `OBJECT` option to `add_dune_mpi_flags`

The `OBJECT` option has to be passed on to `add_dune_mpi_flags`.
Otherwise one will get an error when using the parallel version of UG
with object libraries:

```
CMake Error at [...]/dune-common/cmake/modules/DuneMPI.cmake:62 (target_link_libraries):
  Object library target "[...]" may not link to anything.
Call Stack (most recent call first):
  [...]/dune-grid/cmake/modules/UseUG.cmake:206 (add_dune_mpi_flags)
  [...]/CMakeLists.txt:62 (add_dune_ug_flags)
```
parent e5cf8f2f
Branches
Tags
1 merge request!140Pass `OBJECT` option to `add_dune_mpi_flags`
Pipeline #
......@@ -175,6 +175,12 @@ function(add_dune_ug_flags)
set(_prefix TARGET)
endif()
if(ADD_UG_OBJECT)
set(_object OBJECT)
else()
set(_object)
endif()
# Add compiler flags
include_directories(${UG_INCLUDES})
set_property(${_prefix} ${ADD_UG_UNPARSED_ARGUMENTS}
......@@ -203,7 +209,7 @@ function(add_dune_ug_flags)
APPEND PROPERTY
COMPILE_DEFINITIONS ModelP)
# Add mpi flags.
add_dune_mpi_flags(${ADD_UG_UNPARSED_ARGUMENTS} ${_source_only})
add_dune_mpi_flags(${ADD_UG_UNPARSED_ARGUMENTS} ${_source_only} ${_object})
endif()
endif()
endfunction(add_dune_ug_flags)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment