From 626576b7dab7229c97358b8432fba4076855d0dd Mon Sep 17 00:00:00 2001 From: Josiah VanderZee Date: Thu, 20 Jul 2023 14:28:07 -0500 Subject: [PATCH] Clean up link libraries for traffic_server target --- iocore/aio/CMakeLists.txt | 2 ++ iocore/cache/CMakeLists.txt | 18 ++++++++++--- iocore/dns/CMakeLists.txt | 2 ++ iocore/hostdb/CMakeLists.txt | 2 ++ mgmt/config/CMakeLists.txt | 4 ++- mgmt/rpc/CMakeLists.txt | 3 +++ proxy/http/remap/CMakeLists.txt | 2 ++ proxy/http2/CMakeLists.txt | 2 ++ proxy/logging/CMakeLists.txt | 2 ++ proxy/shared/CMakeLists.txt | 2 ++ src/traffic_server/CMakeLists.txt | 43 ++++++++++++++----------------- 11 files changed, 54 insertions(+), 28 deletions(-) diff --git a/iocore/aio/CMakeLists.txt b/iocore/aio/CMakeLists.txt index c6e7df6f7bf..f93e4127664 100644 --- a/iocore/aio/CMakeLists.txt +++ b/iocore/aio/CMakeLists.txt @@ -17,5 +17,7 @@ add_library(aio STATIC) +add_library(ts::aio ALIAS aio) + target_sources(aio PRIVATE AIO.cc Inline.cc) target_include_directories(aio PRIVATE ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CMAKE_SOURCE_DIR}/iocore/io_uring) diff --git a/iocore/cache/CMakeLists.txt b/iocore/cache/CMakeLists.txt index fd47f624aae..27daa6daf94 100644 --- a/iocore/cache/CMakeLists.txt +++ b/iocore/cache/CMakeLists.txt @@ -31,13 +31,12 @@ add_library(inkcache STATIC RamCacheLRU.cc Store.cc ) +add_library(ts::inkcache ALIAS inkcache) + if(BUILD_REGRESSION_TESTING) target_sources(inkcache PRIVATE CacheTest.cc) endif() -target_link_libraries(inkcache PRIVATE ZLIB::ZLIB) -if(HAVE_LZMA_H) - target_link_libraries(inkcache PRIVATE LibLZMA::LibLZMA) -endif() + target_include_directories(inkcache PRIVATE ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CMAKE_SOURCE_DIR}/iocore/io_uring @@ -52,3 +51,14 @@ target_include_directories(inkcache PRIVATE ${CMAKE_SOURCE_DIR}/proxy/hdrs ${CMAKE_SOURCE_DIR}/lib ) + +target_link_libraries(inkcache + PRIVATE + fastlz + ZLIB::ZLIB +) + +if(HAVE_LZMA_H) + target_link_libraries(inkcache PRIVATE LibLZMA::LibLZMA) +endif() + diff --git a/iocore/dns/CMakeLists.txt b/iocore/dns/CMakeLists.txt index 44e3b6ec7aa..62eedbccbda 100644 --- a/iocore/dns/CMakeLists.txt +++ b/iocore/dns/CMakeLists.txt @@ -22,6 +22,8 @@ add_library(inkdns STATIC Inline.cc SplitDNS.cc ) +add_library(ts::inkdns ALIAS inkdns) + target_include_directories(inkdns PRIVATE ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CMAKE_SOURCE_DIR}/iocore/dns diff --git a/iocore/hostdb/CMakeLists.txt b/iocore/hostdb/CMakeLists.txt index 42378d68bdc..f4e4c95b11d 100644 --- a/iocore/hostdb/CMakeLists.txt +++ b/iocore/hostdb/CMakeLists.txt @@ -23,6 +23,8 @@ add_library(inkhostdb STATIC HostFile.cc HostDBInfo.cc ) +add_library(ts::inkhostdb ALIAS inkhostdb) + target_include_directories(inkhostdb PRIVATE ${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CMAKE_SOURCE_DIR}/iocore/io_uring diff --git a/mgmt/config/CMakeLists.txt b/mgmt/config/CMakeLists.txt index ddc08687d66..8c7b03a3e36 100644 --- a/mgmt/config/CMakeLists.txt +++ b/mgmt/config/CMakeLists.txt @@ -19,10 +19,12 @@ add_library(configmanager STATIC FileManager.cc AddConfigFilesHere.cc ) +add_library(ts::configmanager ALIAS configmanager) + include_directories( ${CMAKE_SOURCE_DIR}/mgmt ${CMAKE_SOURCE_DIR}/proxy ${CMAKE_SOURCE_DIR}/proxy/hdrs ${CMAKE_SOURCE_DIR}/proxy/http ${IOCORE_INCLUDE_DIRS} -) \ No newline at end of file +) diff --git a/mgmt/rpc/CMakeLists.txt b/mgmt/rpc/CMakeLists.txt index 9e9aee25dec..2f25031df1e 100644 --- a/mgmt/rpc/CMakeLists.txt +++ b/mgmt/rpc/CMakeLists.txt @@ -31,6 +31,7 @@ add_library(jsonrpc_protocol STATIC jsonrpc/JsonRPCManager.cc jsonrpc/Context.cc ) +add_library(ts::jsonrpc_protocol ALIAS jsonrpc_protocol) add_library(jsonrpc_server STATIC server/RPCServer.cc @@ -38,6 +39,7 @@ add_library(jsonrpc_server STATIC server/IPCSocketServer.cc config/JsonRPCConfig.cc ) +add_library(ts::jsonrpc_server ALIAS jsonrpc_server) add_library(rpcpublichandlers STATIC handlers/common/RecordsUtils.cc @@ -47,3 +49,4 @@ add_library(rpcpublichandlers STATIC handlers/server/Server.cc handlers/plugins/Plugins.cc ) +add_library(ts::rpcpublichandlers ALIAS rpcpublichandlers) diff --git a/proxy/http/remap/CMakeLists.txt b/proxy/http/remap/CMakeLists.txt index 15b357f7d4c..e2307d81a64 100644 --- a/proxy/http/remap/CMakeLists.txt +++ b/proxy/http/remap/CMakeLists.txt @@ -34,6 +34,8 @@ add_library(http_remap STATIC UrlMappingPathIndex.cc UrlRewrite.cc ) +add_library(ts::http_remap ALIAS http_remap) + target_include_directories(http_remap PRIVATE ${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} diff --git a/proxy/http2/CMakeLists.txt b/proxy/http2/CMakeLists.txt index 464d7a50b31..2be773d6fa3 100644 --- a/proxy/http2/CMakeLists.txt +++ b/proxy/http2/CMakeLists.txt @@ -29,6 +29,8 @@ add_library(http2 STATIC Http2SessionAccept.cc Http2ServerSession.cc ) +add_library(ts::http2 ALIAS http2) + target_include_directories(http2 PRIVATE ${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} diff --git a/proxy/logging/CMakeLists.txt b/proxy/logging/CMakeLists.txt index cbe94e906fa..c3f4acaab7b 100644 --- a/proxy/logging/CMakeLists.txt +++ b/proxy/logging/CMakeLists.txt @@ -32,6 +32,8 @@ add_library(logging STATIC YamlLogConfig.cc YamlLogConfigDecoders.cc ) +add_library(ts::logging ALIAS logging) + target_include_directories(logging PRIVATE ${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} diff --git a/proxy/shared/CMakeLists.txt b/proxy/shared/CMakeLists.txt index 5e93f01a3f3..eee5516291b 100644 --- a/proxy/shared/CMakeLists.txt +++ b/proxy/shared/CMakeLists.txt @@ -17,6 +17,8 @@ add_library(diagsconfig STATIC DiagsConfig.cc) +add_library(ts::diagsconfig ALIAS diagsconfig) + target_include_directories(diagsconfig PRIVATE ${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} diff --git a/src/traffic_server/CMakeLists.txt b/src/traffic_server/CMakeLists.txt index 6152bfb4dce..390c8edefd3 100644 --- a/src/traffic_server/CMakeLists.txt +++ b/src/traffic_server/CMakeLists.txt @@ -34,30 +34,27 @@ target_include_directories(traffic_server PRIVATE ) target_link_libraries(traffic_server PRIVATE - tscore - http - http_remap - http2 - logging - hdrs - configmanager - diagsconfig - inkutils - inkdns - inkhostdb - inkcache - fastlz - aio - tscpputil - proxy - inknet - records - inkevent - yaml-cpp + ts::tscore + ts::http + ts::http_remap + ts::http2 + ts::logging + ts::hdrs + ts::configmanager + ts::diagsconfig + ts::inkutils + ts::inkdns + ts::inkhostdb + ts::inkcache + ts::aio + ts::proxy + ts::inknet + ts::records + ts::inkevent libswoc - jsonrpc_protocol - jsonrpc_server - rpcpublichandlers + ts::jsonrpc_protocol + ts::jsonrpc_server + ts::rpcpublichandlers ) if(TS_USE_QUIC)