Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tribits_add_library( ... HEADERONLY ... ) (#625) #626

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

bartlettroscoe
Copy link
Member

@bartlettroscoe bartlettroscoe commented Feb 18, 2025

Implements #625

Closes #51

rabartlett1972
rabartlett1972 previously approved these changes Feb 21, 2025
Copy link
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that the updated code fixes the STKEmend package in my local build. This is ready to merge and snapshot to Trilinos.

Copy link
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay to merge.

ToDo: We need to check that the SOURCES var is empty if HEADERONLY is passed
in.  Current, we just ignore SOURCES.

Signed-off-by: Roscoe A. Bartlett <[email protected]>
…iBITSPub#625)

This failing test shows that an INTERFACE library was not getting picked up
and linked to the <Package>::all_libs target.

The reason the existing tests all passed after adding the initial support for
HEAERONLY INTERFACE libraries was that I added the interface library
'mixedlang_vector' before the main 'mixedlang' library.  So the new
'mixedlang_vector' library is getting written to the MixedLangTargets.cmake
file and is getting linked to 'mixedlang' and 'mixedlang' was getting liked to
MixedLang::all_libs.  So, anyone that was linking against MixedLang::all_libs
or just the 'mixedlang' LIB (from internal or IMPORTED target) was getting the
include directories being specified in the 'mixedlang_vector' library.

But this implementation fails for TriBITS packages that only have INTERFACE
libraries.  Those are never getting added to the <Package>::all_libs target or
indirectly to targets that do.  This is why the STKEmend package failed
because it has just one HEADERONLY INTERFACE library.

This new added test case ensures that the INTERFACE library does get linked to
the <Package>::all_libs target and will fail if it does not.

The next commit will add the code in TriBITS to fix this test :-)

Signed-off-by: Roscoe A. Bartlett <[email protected]>
…ub#625)

This fixes the previously added failing test :-)

I also had to add logic to not generate the package-config files when doing
installation testing where you are only building the tests and examples.  This
was generating a strange error about export sets.  You should not be
generating packge-config files in these cases.

Also, this change required the update of some other tests.  Now that
INTERFACE_LIBRARY taragets are getting pulled down, the <SubPkg>::all_libs for
subpackage targets are getting added the <ParentPkg>::all_libs target for
parent packages.  This is an intereting case but it works.

Signed-off-by: Roscoe A. Bartlett <[email protected]>
@bartlettroscoe bartlettroscoe merged commit c26021e into TriBITSPub:master Feb 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Header only subpackage error
2 participants