Skip to content

Conversation

@ethanmusser
Copy link
Contributor

@ethanmusser ethanmusser commented Nov 13, 2025

Description

@swift-nav/algint-team

Add an alias target swiftnav::sbp for the existing sbp target.

The alias target allows consumers building libsbp within their file tree to link against the same target as consumers using an externally-built libsbp.

Resolves #1531.

API compatibility

Does this change introduce a API compatibility risk?

No, the previous sbp target is still an option for in-tree consumers.

API compatibility plan

If the above is "Yes", please detail the compatibility (or migration) plan:

N/A

JIRA Reference

N/A

@ethanmusser ethanmusser requested a review from a team as a code owner November 13, 2025 20:28
Copy link
Contributor

@martin4861 martin4861 left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution. I checked the current implementation and saw, that the alias was already set.

swift_add_library(sbp
SOURCES ${libsbp_SRCS}
)
add_library(swiftnav::sbp ALIAS sbp)
Copy link
Contributor

@martin4861 martin4861 Nov 14, 2025

Choose a reason for hiding this comment

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

The alias name is already used internally for the tests.

I dug deeper into the definition of swift_add_library, which creates sbp and turned out, that it already does add_library(${SWIFTNAV_ALIAS}::${target} ALIAS ${target}) in the cmake common lib.
Therefore I would rather not add this line, but I would be fine, if you added a comment, stating, that the alias is already set using swift_add_library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I totally missed that! As long as that target is there then I'm happy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C/C++] CMake: In-tree consumers use different target than external consumers

2 participants