You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2023/06/21 19:14:00 UTC

[trafficserver] branch master updated: Add support for quic to CMake build (#9892)

This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new f8915e08b9 Add support for quic to CMake build (#9892)
f8915e08b9 is described below

commit f8915e08b995a40a6ff8283e31ebb487b82a6ec8
Author: JosiahWI <41...@users.noreply.github.com>
AuthorDate: Wed Jun 21 14:13:53 2023 -0500

    Add support for quic to CMake build (#9892)
    
    This adds an option that defaults to OFF: ENABLE_QUICHE. When quiche
    is enabled, the quic static library and the http3 static library
    will be built and linked appropriately. The traffic_quic executable
    will also be built.
    
    It also does some cleanup of targets in the CMake build. Some
    targets are now namespaced in ts:: to make it explicit which targets
    are part of trafficserver, and to make usage style consistent with
    that of third-party libraries. Some dependencies have also been
    corrected, and comments added where dependencies are misrepresented
    by necessity.
---
 CMakeLists.txt                                     | 14 +++++++
 .../CheckOpenSSLIsBoringSSL.cmake                  | 33 ++++++++-------
 .../CMakeLists.txt => cmake/Findquiche.cmake       | 45 +++++++++++++-------
 include/tscore/ink_config.h.cmake.in               |  4 +-
 iocore/eventsystem/CMakeLists.txt                  | 22 +++++++++-
 iocore/io_uring/CMakeLists.txt                     | 10 ++++-
 iocore/net/CMakeLists.txt                          | 27 +++++++++++-
 {proxy/hdrs => iocore/net/quic}/CMakeLists.txt     | 41 +++++++++++-------
 iocore/utils/CMakeLists.txt                        |  3 ++
 proxy/CMakeLists.txt                               |  8 +++-
 proxy/hdrs/CMakeLists.txt                          | 15 ++++++-
 proxy/http/CMakeLists.txt                          |  7 ++++
 {iocore/io_uring => proxy/http3}/CMakeLists.txt    | 49 +++++++++++++++-------
 src/records/CMakeLists.txt                         | 29 +++++++++----
 src/traffic_server/CMakeLists.txt                  |  8 ++++
 src/tscore/CMakeLists.txt                          |  2 +
 src/tscpp/util/CMakeLists.txt                      |  9 +++-
 17 files changed, 246 insertions(+), 80 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a26ff8335..d0ca6a924f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,7 @@ set(ENABLE_TPROXY
         'X' where X is a number to use as the IP_TRANSPARENT sockopt,
         anything else to enable."
 )
+option(ENABLE_QUICHE   "Use quiche (default OFF)")
 option(ENABLE_UNWIND   "Use libunwind if found on system (default ON)" ON)
 option(ENABLE_WCCP     "Use WCCP v2 (default OFF)")
 set(TS_MAX_HOST_NAME_LEN 256 CACHE STRING "Max host name length (default 256)")
@@ -187,6 +188,19 @@ if(ENABLE_UNWIND)
     set(TS_USE_REMOTE_UNWINDING ${unwind_FOUND})
 endif()
 
+if(ENABLE_QUICHE)
+    find_package(quiche REQUIRED)
+
+    set(TS_HAS_QUICHE ${quiche_FOUND})
+    set(TS_USE_QUIC ${TS_HAS_QUICHE})
+
+    include(CheckOpenSSLIsBoringSSL)
+    check_openssl_is_boringssl(TS_HAVE_BORINGSSL "${OPENSSL_INCLUDE_DIR}")
+    if(NOT TS_HAVE_BORINGSSL)
+        message(FATAL_ERROR "Use of BoringSSL is required if quiche is used.")
+    endif()
+endif()
+
 find_package(ZLIB REQUIRED)
 
 include(Check128BitCas)
diff --git a/proxy/hdrs/CMakeLists.txt b/cmake/CheckOpenSSLIsBoringSSL.cmake
similarity index 65%
copy from proxy/hdrs/CMakeLists.txt
copy to cmake/CheckOpenSSLIsBoringSSL.cmake
index 232c27c39f..8d12c4702d 100644
--- a/proxy/hdrs/CMakeLists.txt
+++ b/cmake/CheckOpenSSLIsBoringSSL.cmake
@@ -15,20 +15,21 @@
 #
 #######################
 
+function(CHECK_OPENSSL_IS_BORINGSSL OUT_VAR OPENSSL_INCLUDE_DIR)
+    set(CHECK_PROGRAM
+        "
+        #include <openssl/base.h>
 
-add_library(hdrs STATIC
-        HTTP.cc
-        HdrHeap.cc
-        HdrTSOnly.cc
-        HdrToken.cc
-        HdrUtils.cc
-        HttpCompat.cc
-        MIME.cc
-        URL.cc
-        VersionConverter.cc
-        HuffmanCodec.cc
-        XPACK.cc
-)
-target_include_directories(hdrs PRIVATE
-        ${IOCORE_INCLUDE_DIRS}
-)
\ No newline at end of file
+        #ifndef OPENSSL_IS_BORINGSSL
+        #error check failed
+        #endif
+
+        int main() {
+            return 0;
+        }
+        "
+    )
+    set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
+    include(CheckCXXSourceCompiles)
+    check_cxx_source_compiles("${CHECK_PROGRAM}" ${OUT_VAR})
+endfunction()
diff --git a/iocore/io_uring/CMakeLists.txt b/cmake/Findquiche.cmake
similarity index 50%
copy from iocore/io_uring/CMakeLists.txt
copy to cmake/Findquiche.cmake
index 0ae18bdd5d..66123227bd 100644
--- a/iocore/io_uring/CMakeLists.txt
+++ b/cmake/Findquiche.cmake
@@ -15,22 +15,35 @@
 #
 #######################
 
-add_library(inkuring STATIC
-        io_uring.cc
-)
-include_directories(
-        ${CMAKE_SOURCE_DIR}/iocore/eventsystem
-        ${CMAKE_SOURCE_DIR}/iocore/dns
-        ${CMAKE_SOURCE_DIR}/iocore/aio
-        ${CMAKE_SOURCE_DIR}/iocore/io_uring
-        ${CMAKE_SOURCE_DIR}/iocore/net
-        ${CMAKE_SOURCE_DIR}/iocore/cache
-        ${CMAKE_SOURCE_DIR}/iocore/hostdb
+# Findquiche.cmake
+#
+# This will define the following variables
+#
+#     quiche_FOUND
+#     quiche_LIBRARY
+#     quiche_INCLUDE_DIRS
+#
+# and the following imported targets
+#
+#     quiche::quiche
+#
+
+find_library(quiche_LIBRARY NAMES quiche)
+find_path(quiche_INCLUDE_DIR NAMES quiche.h PATH_SUFFIXES)
+
+mark_as_advanced(quiche_FOUND quiche_LIBRARY quiche_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(quiche
+    REQUIRED_VARS quiche_LIBRARY quiche_INCLUDE_DIR
 )
 
-add_executable(test_iouring
-        unit_tests/test_diskIO.cc)
-target_link_libraries(test_iouring PRIVATE tscore inkuring tscpputil libswoc uring)
-target_include_directories(test_iouring PRIVATE ${CMAKE_SOURCE_DIR}/include ${CATCH_INCLUDE_DIR})
+if(quiche_FOUND)
+    set(quiche_INCLUDE_DIRS "${quiche_INCLUDE_DIR}")
+endif()
 
-add_test(NAME test_iouring COMMAND $<TARGET_FILE:test_iouring>)
+if(quiche_FOUND AND NOT TARGET quiche::quiche)
+    add_library(quiche::quiche INTERFACE IMPORTED)
+    target_include_directories(quiche::quiche INTERFACE ${quiche_INCLUDE_DIRS})
+    target_link_libraries(quiche::quiche INTERFACE "${quiche_LIBRARY}")
+endif()
diff --git a/include/tscore/ink_config.h.cmake.in b/include/tscore/ink_config.h.cmake.in
index 12f39fee4b..e1a21d1782 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -119,10 +119,11 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_HAS_IP_TOS
 #cmakedefine01 TS_HAS_JEMALLOC
 #cmakedefine01 TS_HAS_TCMALLOC
-#cmakedefine01 TS_HAS_TESTS
 #cmakedefine01 TS_HAS_PROFILER
+#cmakedefine01 TS_HAS_QUICHE
 #cmakedefine01 TS_HAS_SO_MARK
 #cmakedefine01 TS_HAS_SO_PEERCRED
+#cmakedefine01 TS_HAS_TESTS
 #cmakedefine01 TS_HAS_WCCP
 #cmakedefine01 TS_USE_DIAGS
 #cmakedefine01 TS_USE_EPOLL
@@ -133,6 +134,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_USE_LINUX_IO_URING
 #cmakedefine01 TS_USE_LINUX_NATIVE_AIO
 #cmakedefine01 TS_USE_POSIX_CAP
+#cmakedefine01 TS_USE_QUIC
 #cmakedefine01 TS_USE_REMOTE_UNWINDING
 #cmakedefine01 TS_USE_SET_RBIO
 #cmakedefine01 TS_USE_TLS13
diff --git a/iocore/eventsystem/CMakeLists.txt b/iocore/eventsystem/CMakeLists.txt
index 556336aa1a..7100794c32 100644
--- a/iocore/eventsystem/CMakeLists.txt
+++ b/iocore/eventsystem/CMakeLists.txt
@@ -35,5 +35,23 @@ add_library(inkevent STATIC
         ConfigProcessor.cc
         RecRawStatsImpl.cc
         RecProcess.cc)
-target_include_directories(inkevent PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
-target_link_libraries(inkevent ${PCRE_LIBRARIES} ${OPENSSL_LIBRARIES} yaml-cpp::yaml-cpp tscpputil resolv libswoc tscore records_p)
\ No newline at end of file
+add_library(ts::inkevent ALIAS inkevent)
+
+target_include_directories(inkevent PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
+
+target_link_libraries(inkevent
+    PUBLIC
+        ts::records_p
+        ts::tscore
+    PRIVATE
+        libswoc
+        ${OPENSSL_LIBRARIES} # transitive
+        ${PCRE_LIBRARIES} # transitive
+        resolv # transitive
+        tscpputil # transitive
+        yaml-cpp::yaml-cpp # transitive
+)
+
+if(TS_USE_HWLOC)
+        target_link_libraries(inkevent PRIVATE hwloc::hwloc)
+endif()
diff --git a/iocore/io_uring/CMakeLists.txt b/iocore/io_uring/CMakeLists.txt
index 0ae18bdd5d..223ed949a5 100644
--- a/iocore/io_uring/CMakeLists.txt
+++ b/iocore/io_uring/CMakeLists.txt
@@ -30,7 +30,15 @@ include_directories(
 
 add_executable(test_iouring
         unit_tests/test_diskIO.cc)
-target_link_libraries(test_iouring PRIVATE tscore inkuring tscpputil libswoc uring)
+target_link_libraries(test_iouring
+    PRIVATE
+        inkuring
+        libswoc
+        ts::tscore
+        tscpputil
+        uring
+)
+
 target_include_directories(test_iouring PRIVATE ${CMAKE_SOURCE_DIR}/include ${CATCH_INCLUDE_DIR})
 
 add_test(NAME test_iouring COMMAND $<TARGET_FILE:test_iouring>)
diff --git a/iocore/net/CMakeLists.txt b/iocore/net/CMakeLists.txt
index d726cc9c3b..7aed806c98 100644
--- a/iocore/net/CMakeLists.txt
+++ b/iocore/net/CMakeLists.txt
@@ -64,12 +64,37 @@ add_library(inknet STATIC
         SSLDynlock.cc
         SNIActionPerformer.cc
         )
+add_library(ts::inknet ALIAS inknet)
+
+if(TS_USE_QUIC)
+    add_subdirectory(quic)
+
+    target_sources(inknet
+        PRIVATE
+            QUICClosedConCollector.cc
+            QUICMultiCertConfigLoader.cc
+            QUICNet.cc
+            QUICNetProcessor_quiche.cc
+            QUICNetVConnection_quiche.cc
+            QUICNextProtocolAccept_quiche.cc
+            QUICPacketHandler_quiche.cc
+    )
+
+    target_link_libraries(inknet
+        PUBLIC
+            quiche::quiche
+            ts::quic
+    )
+endif()
+
+
 if(BUILD_REGRESSION_TESTING)
     target_sources(inknet PRIVATE NetVCTest.cc)
 endif()
+
 target_link_libraries(inknet PUBLIC inkevent records_p)
 target_compile_options(inknet PUBLIC -Wno-deprecated-declarations)
-target_include_directories(inknet PRIVATE
+target_include_directories(inknet PUBLIC
         ${CMAKE_SOURCE_DIR}/iocore/eventsystem
         ${CMAKE_SOURCE_DIR}/iocore/dns
         ${CMAKE_SOURCE_DIR}/iocore/io_uring
diff --git a/proxy/hdrs/CMakeLists.txt b/iocore/net/quic/CMakeLists.txt
similarity index 58%
copy from proxy/hdrs/CMakeLists.txt
copy to iocore/net/quic/CMakeLists.txt
index 232c27c39f..73ed59206a 100644
--- a/proxy/hdrs/CMakeLists.txt
+++ b/iocore/net/quic/CMakeLists.txt
@@ -15,20 +15,31 @@
 #
 #######################
 
+add_library(quic STATIC
+    QUICApplication.cc
+    QUICApplicationMap.cc
+    QUICConfig.cc
+    QUICContext.cc
+    QUICConnectionTable.cc
+    QUICGlobals.cc
+    QUICTypes.cc
+    QUICIntUtil.cc
+    QUICStream.cc
+    QUICStream_quiche.cc
+    QUICStreamManager.cc
+    QUICStreamManager_quiche.cc
+    QUICStreamAdapter.cc
+    QUICStreamVCAdapter.cc
+)
+add_library(ts::quic ALIAS quic)
+
+target_include_directories(quic PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
 
-add_library(hdrs STATIC
-        HTTP.cc
-        HdrHeap.cc
-        HdrTSOnly.cc
-        HdrToken.cc
-        HdrUtils.cc
-        HttpCompat.cc
-        MIME.cc
-        URL.cc
-        VersionConverter.cc
-        HuffmanCodec.cc
-        XPACK.cc
+target_link_libraries(quic
+    PUBLIC
+        inkevent
+        inknet
+        ${OPENSSL_LIBRARY}
+        quiche::quiche
+        ts::tscore
 )
-target_include_directories(hdrs PRIVATE
-        ${IOCORE_INCLUDE_DIRS}
-)
\ No newline at end of file
diff --git a/iocore/utils/CMakeLists.txt b/iocore/utils/CMakeLists.txt
index 2035a2dcaf..14c2bfe27f 100644
--- a/iocore/utils/CMakeLists.txt
+++ b/iocore/utils/CMakeLists.txt
@@ -17,6 +17,9 @@
 
 
 add_library(inkutils STATIC Machine.cc OneWayMultiTunnel.cc OneWayTunnel.cc)
+add_library(ts::inkutils ALIAS inkutils)
+
+
 target_include_directories(inkutils PRIVATE
         ${CMAKE_SOURCE_DIR}/iocore/eventsystem
         ${CMAKE_SOURCE_DIR}/iocore/dns
diff --git a/proxy/CMakeLists.txt b/proxy/CMakeLists.txt
index eb95e79723..43c2e1ad48 100644
--- a/proxy/CMakeLists.txt
+++ b/proxy/CMakeLists.txt
@@ -35,6 +35,8 @@ add_library(proxy STATIC
         StatPages.cc
         Transform.cc
 )
+add_library(ts::proxy ALIAS proxy)
+
 if(BUILD_REGRESSION_TESTING)
     target_sources(proxy PRIVATE RegressionSM.cc)
 endif()
@@ -50,7 +52,7 @@ set(PROXY_INCLUDE_DIRS
 )
 set(PROXY_INCLUDE_DIRS ${PROXY_INCLUDE_DIRS} PARENT_SCOPE)
 
-target_include_directories(proxy PRIVATE
+target_include_directories(proxy PUBLIC
         ${IOCORE_INCLUDE_DIRS}
         ${PROXY_INCLUDE_DIRS}
         ${CMAKE_SOURCE_DIR}/mgmt
@@ -63,3 +65,7 @@ add_subdirectory(shared)
 add_subdirectory(http)
 add_subdirectory(http2)
 add_subdirectory(logging)
+
+if(TS_USE_QUIC)
+    add_subdirectory(http3)
+endif()
diff --git a/proxy/hdrs/CMakeLists.txt b/proxy/hdrs/CMakeLists.txt
index 232c27c39f..65b27578a1 100644
--- a/proxy/hdrs/CMakeLists.txt
+++ b/proxy/hdrs/CMakeLists.txt
@@ -29,6 +29,17 @@ add_library(hdrs STATIC
         HuffmanCodec.cc
         XPACK.cc
 )
-target_include_directories(hdrs PRIVATE
+add_library(ts::hdrs ALIAS hdrs)
+
+target_include_directories(hdrs
+    PUBLIC
+        "${CMAKE_CURRENT_SOURCE_DIR}"
+    PRIVATE
         ${IOCORE_INCLUDE_DIRS}
-)
\ No newline at end of file
+)
+
+target_link_libraries(hdrs
+    PUBLIC
+        libswoc
+        ts::tscore
+)
diff --git a/proxy/http/CMakeLists.txt b/proxy/http/CMakeLists.txt
index 35d20aed8f..5c33b55c04 100644
--- a/proxy/http/CMakeLists.txt
+++ b/proxy/http/CMakeLists.txt
@@ -40,6 +40,8 @@ add_library(http STATIC
         PreWarmConfig.cc
         PreWarmManager.cc
 )
+add_library(ts::http ALIAS http)
+
 if(BUILD_REGRESSION_TESTING)
     target_sources(http PRIVATE RegressionHttpTransact.cc)
 endif()
@@ -51,4 +53,9 @@ target_include_directories(http PRIVATE
         ${CMAKE_SOURCE_DIR}/mgmt/utils
         ${YAMLCPP_INCLUDE_DIR}
 )
+
+if(TS_USE_QUIC)
+    target_link_libraries(http PRIVATE ts::http3)
+endif()
+
 add_subdirectory(remap)
diff --git a/iocore/io_uring/CMakeLists.txt b/proxy/http3/CMakeLists.txt
similarity index 53%
copy from iocore/io_uring/CMakeLists.txt
copy to proxy/http3/CMakeLists.txt
index 0ae18bdd5d..4bd04727cf 100644
--- a/iocore/io_uring/CMakeLists.txt
+++ b/proxy/http3/CMakeLists.txt
@@ -15,22 +15,39 @@
 #
 #######################
 
-add_library(inkuring STATIC
-        io_uring.cc
-)
-include_directories(
-        ${CMAKE_SOURCE_DIR}/iocore/eventsystem
-        ${CMAKE_SOURCE_DIR}/iocore/dns
-        ${CMAKE_SOURCE_DIR}/iocore/aio
-        ${CMAKE_SOURCE_DIR}/iocore/io_uring
-        ${CMAKE_SOURCE_DIR}/iocore/net
-        ${CMAKE_SOURCE_DIR}/iocore/cache
-        ${CMAKE_SOURCE_DIR}/iocore/hostdb
+add_library(http3 STATIC
+    Http09App.cc
+    Http3.cc
+    Http3Config.cc
+    Http3App.cc
+    Http3Types.cc
+    Http3SessionAccept.cc
+    Http3Session.cc
+    Http3Transaction.cc
+    Http3DebugNames.cc
+    Http3Frame.cc
+    Http3FrameCollector.cc
+    Http3FrameDispatcher.cc
+    Http3HeaderFramer.cc
+    Http3DataFramer.cc
+    Http3HeaderVIOAdaptor.cc
+    Http3StreamDataVIOAdaptor.cc
+    QPACK.cc
 )
+add_library(ts::http3 ALIAS http3)
 
-add_executable(test_iouring
-        unit_tests/test_diskIO.cc)
-target_link_libraries(test_iouring PRIVATE tscore inkuring tscpputil libswoc uring)
-target_include_directories(test_iouring PRIVATE ${CMAKE_SOURCE_DIR}/include ${CATCH_INCLUDE_DIR})
+target_include_directories(http3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
 
-add_test(NAME test_iouring COMMAND $<TARGET_FILE:test_iouring>)
+target_link_libraries(http3
+    PUBLIC
+        ts::hdrs
+        ts::http
+        ts::inknet
+        ts::inkutils
+        ts::inkevent
+        ts::proxy
+        ts::quic
+        ts::records_p
+        ts::tscpputil
+        ts::tscore
+)
diff --git a/src/records/CMakeLists.txt b/src/records/CMakeLists.txt
index a32811e8d6..2425082b7c 100644
--- a/src/records/CMakeLists.txt
+++ b/src/records/CMakeLists.txt
@@ -30,13 +30,26 @@ add_library(records_p SHARED
         RecordsConfigUtils.cc
         RecRawStats.cc
         )
+add_library(ts::records_p ALIAS records_p)
+
+target_include_directories(records_p
+    PUBLIC
+        "${PROJECT_SOURCE_DIR}/include"
+    PRIVATE
+        "${CMAKE_SOURCE_DIR}/mgmt"
+        "${CMAKE_SOURCE_DIR}/mgmt/api/include"
+        "${CMAKE_SOURCE_DIR}/mgmt/utils"
+        "${CMAKE_SOURCE_DIR}/iocore/eventsystem"
+        "${CMAKE_SOURCE_DIR}/iocore/utils"
+)
+
+target_link_libraries(records_p
+    PUBLIC
+        libswoc
+        #ts::inkevent cyclic dependency; I_RecProcess.h and P_RecProcess.h
+        ts::tscore
+        ts::tscpputil
+        yaml-cpp::yaml-cpp
+)
 
-target_include_directories(records_p PRIVATE
-        ${CMAKE_SOURCE_DIR}/mgmt
-        ${CMAKE_SOURCE_DIR}/mgmt/api/include
-        ${CMAKE_SOURCE_DIR}/mgmt/utils
-        ${CMAKE_SOURCE_DIR}/iocore/eventsystem
-        ${CMAKE_SOURCE_DIR}/iocore/utils
-        )
-target_link_libraries(records_p tscore libswoc yaml-cpp::yaml-cpp)
 install(TARGETS records_p)
diff --git a/src/traffic_server/CMakeLists.txt b/src/traffic_server/CMakeLists.txt
index c243613a56..e8d239c7c0 100644
--- a/src/traffic_server/CMakeLists.txt
+++ b/src/traffic_server/CMakeLists.txt
@@ -62,6 +62,14 @@ target_link_libraries(traffic_server
         rpcpublichandlers
 )
 
+if(TS_USE_QUIC)
+    target_link_libraries(traffic_server
+        PRIVATE
+            ts::http3
+            ts::quic
+    )
+endif()
+
 if(TS_HAS_PROFILER)
     target_link_libraries(traffic_server PRIVATE gperftools::profiler)
 endif()
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 8e52bb89da..f7296a86ac 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -101,6 +101,8 @@ add_library(tscore SHARED
         runroot.cc
         signals.cc
 )
+add_library(ts::tscore ALIAS tscore)
+
 add_dependencies(tscore ParseRules tscpputil)
 target_include_directories(tscore PRIVATE
         ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/src/tscpp/util/CMakeLists.txt b/src/tscpp/util/CMakeLists.txt
index f38ab42139..2d02673fd5 100644
--- a/src/tscpp/util/CMakeLists.txt
+++ b/src/tscpp/util/CMakeLists.txt
@@ -22,7 +22,14 @@ add_library(tscpputil SHARED
         TextView.cc
         YamlCfg.cc
         ts_unit_parser.cc)
-target_link_libraries(tscpputil PRIVATE yaml-cpp libswoc)
+add_library(ts::tscpputil ALIAS tscpputil)
+
+target_link_libraries(tscpputil
+    PUBLIC
+        libswoc
+        # ts::tscore cyclic dependency
+        yaml-cpp::yaml-cpp
+)
 
 add_executable(test_tscpputil
         unit_tests/test_IntrusiveDList.cc