Skip to content

Default to PRIVATE dependency on std::filesystem

Mark Abraham requested to merge improve-std-filesystem-exposure into release-2023

In some cases, when the compiler is depending on an early version of a C++17 standard library that had not yet integrated support for std::filesystem into the main library (even though the symbols are found in the std namespace), an extra library is needed for libgromacs at link time.

Formerly that dependency was exposed in the PUBLIC interface of libgromacs, which means that library must also be linked by projects that link to libgromacs. However, that is only necessary for GROMACS installations that support the legacy API, because only those headers expose symbols from std::filesystem namespace.

This change means that the public dependency is only created in the case that needs it. This may help downstream projects not using the legacy API avoid needing to manage extra link-time dependencies.

Refs #4728 (closed) Refs #4796 (closed)

Merge request reports