JosiahWI commented on code in PR #10780:
URL: https://github.com/apache/trafficserver/pull/10780#discussion_r1394639739
##########
lib/swoc/CMakeLists.txt:
##########
@@ -118,3 +118,6 @@ set_target_properties(
)
install(TARGETS libswoc PUBLIC_HEADER DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/swoc)
+
+add_library(libswoc::libswoc ALIAS libswoc-static)
+add_library(libswoc::libswoc ALIAS libswoc)
Review Comment:
Maybe you can provide some context on why it was done this way. If we decide
to keep this, we should definitely comment it, or this will be a "whoa there"
moment for everyone who lays eyes on this in the future.
If we want to automatically pick up either the static or dynamic libswoc,
depending on which one was found, then we do want one target that could
represent either. But this does not look to me like the correct way to go about
it. How come this even works? Some projects have both a static and dynamic
target and install both of them - what does CMake do if both targets exist?
Does `libswoc::libswoc` end up aliasing the static one, or the dynamic one? Or
does CMake error out?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]