Skip to content

Handle optional dependency SuiteSparse by directly passing HAVE_xxx flags

Simon Praetorius requested to merge feature/have-suitesparse-flags into master

Summary

This MR tries to solve an issue with localized config.h files as introduces in !1262 (merged) in the handling of optional dependencies. For a package that is found in an upstream module, like dune-common, but that is used for the first time in a downstream module, we cannot fix the flags HAVE_SUITESPARSE already in upstream. It might be that a user installs SuiteSparse later. This was no problem in the old handling of config.h files when everything is regenerated downstreams, but we want to generate local config.h files in the modules that provide the flags. For purely optional packages, the solution is to introduce the HAVE_SUITESPARSE flag directly downstream and not with the indirection of an ENABLE_SUITESPARSE flag.

Necessary changes for module authors

Nothing! everything is changed in the add_dune_suitesparse_flags macro and the dune_register_package_flags call. Those are executed in downstream modules as before.

This MR acts as a preprint for changes in other modules that also want to provide purely optional packages that are not used by the module itself, but only by downstream modules. Note that protected headers that are not compiled in a library are still fine to be provided in the upstream module.

Closes #252 (closed)

Edited by Simon Praetorius

Merge request reports