Skip to content

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

Merged
bartlettroscoe merged 3 commits intoTriBITSPub:masterfrom
bartlettroscoe:625-headeronly-libs
Feb 21, 2025
Merged

Add support for tribits_add_library( ... HEADERONLY ... ) (#625)#626
bartlettroscoe merged 3 commits intoTriBITSPub:masterfrom
bartlettroscoe:625-headeronly-libs

Conversation

@bartlettroscoe
Copy link
Copy Markdown
Member

@bartlettroscoe bartlettroscoe commented Feb 18, 2025

Implements #625

Closes #51

rabartlett1972
rabartlett1972 previously approved these changes Feb 21, 2025
Copy link
Copy Markdown
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
Copy Markdown
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 <rabartl@sandia.gov>
…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 <rabartl@sandia.gov>
…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 <rabartl@sandia.gov>
@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