Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a build issue from iocore cleanup #12000

Merged
merged 8 commits into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion src/iocore/net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,41 @@ if(TS_USE_LINUX_IO_URING)
endif()

if(BUILD_TESTING)
# libinknet_stub.cc is need because GNU ld is sensitive to the order of static libraries on the command line, and we have a cyclic dependency between inknet and proxy
add_executable(
test_net libinknet_stub.cc NetVCTest.cc unit_tests/test_ProxyProtocol.cc unit_tests/test_SSLSNIConfig.cc
unit_tests/test_YamlSNIConfig.cc unit_tests/unit_test_main.cc
)
target_link_libraries(test_net PRIVATE ts::inknet catch2::catch2)
if(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED)
# Use link groups to solve circular dependency
set(LINK_GROUP_LIBS
ts::logging
ts::inknet
ts::inkhostdb
ts::proxy
ts::tsapibackend
ts::inkdns
ts::http2
ts::inkcache
ts::rpcpublichandlers
ts::overridable_txn_vars
ts::http
ts::http_remap
)
if(TS_USE_QUIC)
list(APPEND LINK_GROUP_LIBS quic http3)
endif()
string(JOIN "," LINK_GROUP_LIBS_CSV ${LINK_GROUP_LIBS})
target_link_libraries(
test_net PRIVATE catch2::catch2 ts::tscore "$<LINK_GROUP:RESCAN,${LINK_GROUP_LIBS_CSV}>" ts::tsutil ts::inkevent
libswoc::libswoc
)
else()
# These linkers already do the equivalent of RESCAN, so there's no support in cmake for it
# This case is mainly for macOS
# The reason that the list is different here, is because a careful ordering is necessary to prevent duplicate symbols, which are not allowed on macOS
target_link_libraries(test_net PRIVATE catch2::catch2 ts::tscore ts::proxy ts::inknet ts::inkevent libswoc::libswoc)
endif()
if(NOT APPLE)
target_link_options(test_net PRIVATE -Wl,--allow-multiple-definition)
endif()
Expand Down