JosiahWI commented on code in PR #9974:
URL: https://github.com/apache/trafficserver/pull/9974#discussion_r1261819002


##########
src/traffic_server/CMakeLists.txt:
##########
@@ -80,6 +80,9 @@ endif (TS_USE_LINUX_IO_URING)
 if (TS_USE_LINUX_NATIVE_AIO)
     target_link_libraries(traffic_server PRIVATE aio)
 endif (TS_USE_LINUX_NATIVE_AIO)
+if(TS_USE_POSIX_CAP)
+    target_link_libraries(traffic_server PUBLIC cap::cap)
+endif()

Review Comment:
   I don't think traffic_server has a direct dependency on libpcap, so it 
should not be linked here. Let CMake take care of resolving the transitive 
dependencies.
   
   ```cmake
   add_library(dependency dependency.cc)
   
   target_link_libraries(dependency PUBLIC transitive::transitive)
   
   add_executable(main main.cc)
   
   target_link_libraries(main PRIVATE dependency)
   ```
   
   CMake will link main to transitive::transitive if dependency is STATIC; if 
dependency is SHARED, then include paths for transitive::transitive will be 
added to main, but the library will not be linked.
   
   This is the ideal. We can't do it everywhere in ATS yet because our 
dependency graph is a nightmare; if we really have to link directly to the 
transitive dependency for now, let's mark it so we know it should be fixed 
later.
   
   This applies to a number of targets changed in this PR.



-- 
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]

Reply via email to