Fix plugin cmake for release only #6070
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a fix for #6017. The problem was that if we build ASPECT in release only mode and then set up an external library, the user already sets up a target with the original library name (
${_target}
) in the CMakeLists.txt of the plugin. Then the macro inAspectConfig.cmake.in
would set up another target with name${_target}.release
, and only for this additional target would it configure the correct include files. But when runningmake
the makefile would then try to compile both targets (with the same sources, but only one of them had correctly configured header files).I changed the macro to now reuse the target name from the user CMakeLists for the release library. If no debug library is compiled, no new target name is necessary (this means the release target has a different name depending on whether a debug target exists).
I also modified the creation of the symbolic links at the end, so that all existing ASPECT executables (
aspect-debug
and/oraspect-release
) and the generic linkaspect
are available in the plugin directory.