Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down Expand Up @@ -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)
Expand Down
35 changes: 35 additions & 0 deletions cmake/CheckOpenSSLIsBoringSSL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################

function(CHECK_OPENSSL_IS_BORINGSSL OUT_VAR OPENSSL_INCLUDE_DIR)
set(CHECK_PROGRAM
"
#include <openssl/base.h>

#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()
49 changes: 49 additions & 0 deletions cmake/Findquiche.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################

# 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
)

if(quiche_FOUND)
set(quiche_INCLUDE_DIRS "${quiche_INCLUDE_DIR}")
endif()

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()
4 changes: 3 additions & 1 deletion include/tscore/ink_config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 20 additions & 2 deletions iocore/eventsystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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()
10 changes: 9 additions & 1 deletion iocore/io_uring/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
27 changes: 26 additions & 1 deletion iocore/net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions iocore/net/quic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################

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}")

target_link_libraries(quic
PUBLIC
inkevent
inknet
${OPENSSL_LIBRARY}
quiche::quiche
ts::tscore
)
3 changes: 3 additions & 0 deletions iocore/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -63,3 +65,7 @@ add_subdirectory(shared)
add_subdirectory(http)
add_subdirectory(http2)
add_subdirectory(logging)

if(TS_USE_QUIC)
add_subdirectory(http3)
endif()
15 changes: 13 additions & 2 deletions proxy/hdrs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
)

target_link_libraries(hdrs
PUBLIC
libswoc
ts::tscore
)
7 changes: 7 additions & 0 deletions proxy/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
53 changes: 53 additions & 0 deletions proxy/http3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#######################
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
# agreements. See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
#######################

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)

target_include_directories(http3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")

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
)
Loading