Include ouster_mapping in shared_library when BUILD_MAPPING is enabled
#676
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.
fix(mapping): include ouster_mapping in shared_library when BUILD_MAPPING is enabled
Hi!
While trying to bring the latest version to Conan Center Index (PR: conan-io/conan-center-index#28804) I found this problem while building the test_package:
When building with
BUILD_SHARED_LIBRARY=ONandBUILD_MAPPING=ON, theouster_mappingcomponent is not properly included in theshared_librarytarget. This causes linking errors because:ouster_mappingobject files are not added toshared_libraryviatarget_sources()ouster_mappingtarget is not linked inouster_library_common(), so its dependencies and include directories are not propagatedHere is the log failing:
Details
This PR adds the missing integration of
ouster_mappingintoshared_libraryby:ouster_mappingobject files toshared_librarywhen the target exists (following the same pattern as other components)ouster_mappingand propagating its include directories inouster_library_common()whenBUILD_MAPPINGis enabledHere is the successful log after the fix:
Details
This fix ensures that when
BUILD_SHARED_LIBRARY=ONandBUILD_MAPPING=ON, allouster_mappingsymbols and its transitive dependencies are correctly included in the shared library, resolving undefined symbol errors at link time.