User-authored solvers often need to reuse functionality implemented in Nektar's built-in solvers. At the moment this usually entails copy-pasting the source.
This PR adds a CMake macro and an associated config option that allow separate libraries to be generated for each built-in solver.
- Adds two new optional arguments to
TARGET_SUFFIXwhich can be used to set a target name that differs from the library's output name (defaults to "")
LINK_MODE("public"/"private"/"interface"; defaults to "public")
ADD_SOLVER_LIBRARY- a wrapper around
- Reuses objects generated when building the solver executable, where possible
- Passes a suffix to ADD_SOLVER_LIBRARY that changes the target name, avoiding a clash with the solver executable
NEKTAR_BUILD_SOLVER_LIBSas a config option
- Turning this on triggers a library build for all enabled solvers
- For now, a build is only set up for CompressibleFlowSolver, other solvers just give a "library build not set up" message
- Adding a new solver library is just a matter of collecting a list of headers and passing them to
I also needed to set
POSITION_INDEPENDENT_CODE=ON when building the object libraries for each executable.
Functions and classes, or changes to them, are documented.
Changelog is updated.
Contributed code is correctly formatted. (See the contributing guidelines).
No extraneous files have been added (e.g. compiler output or test data files).