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 f430f50d02 Add traffic_wccp to CMake build (#9867)
f430f50d02 is described below
commit f430f50d02bf90d9d102a36e16330bcc6d9225a6
Author: JosiahWI <[email protected]>
AuthorDate: Fri Jun 16 19:17:17 2023 -0500
Add traffic_wccp to CMake build (#9867)
This adds a new option that defaults to OFF: ENABLE_WCCP. When this
option is enabled, CMake will configure the project to build the
wccp library and the traffic_wccp executable that uses it.
---
CMakeLists.txt | 10 ++++++++--
include/tscore/ink_config.h.cmake.in | 1 +
src/traffic_wccp/CMakeLists.txt | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 691ac7d393..765cdbeb66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,7 +48,8 @@ option(ENABLE_POSIX_CAP
)
option(ENABLE_PROFILER "Use gperftools profiler (default OFF)")
option(ENABLE_TCMALLOC "Use TCMalloc (default OFF)")
-option(ENABLE_UNWIND "Use libunwind if found on system (default ON)" ON)
+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)")
set(TS_USE_SET_RBIO 1 CACHE STRING "Use openssl set_rbio (default 1)")
set(TS_USE_DIAGS 1 CACHE STRING "Use diags (default 1)")
@@ -64,6 +65,8 @@ set(TS_LIBTOOL_VERSION
${TS_LIBTOOL_MAJOR}:${TS_VERSION_MICRO}:${TS_VERSION_MINO
set(TS_VERSION_STRING TS_VERSION_S)
set(TS_VERSION_NUMBER TS_VERSION_N)
+set(TS_HAS_WCCP ${ENABLE_WCCP})
+
# Check include files
include(CheckIncludeFile)
@@ -276,7 +279,6 @@ enable_testing()
add_subdirectory(src/tscpp/util)
add_subdirectory(src/tscpp/api)
add_subdirectory(src/tscore)
-add_subdirectory(src/wccp)
add_subdirectory(src/records)
add_subdirectory(iocore)
add_subdirectory(proxy)
@@ -285,6 +287,10 @@ add_subdirectory(mgmt/config)
add_subdirectory(mgmt/rpc)
add_subdirectory(src/traffic_server)
add_subdirectory(src/traffic_ctl)
+if(ENABLE_WCCP)
+ add_subdirectory(src/wccp)
+ add_subdirectory(src/traffic_wccp)
+endif()
add_subdirectory(src/tests)
add_subdirectory(plugins)
add_subdirectory(configs)
diff --git a/include/tscore/ink_config.h.cmake.in
b/include/tscore/ink_config.h.cmake.in
index 8ae1dcc945..3075dc43f4 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -119,6 +119,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
#cmakedefine01 TS_HAS_PROFILER
#cmakedefine01 TS_HAS_SO_MARK
#cmakedefine01 TS_HAS_SO_PEERCRED
+#cmakedefine01 TS_HAS_WCCP
#cmakedefine01 TS_USE_DIAGS
#cmakedefine01 TS_USE_EPOLL
#cmakedefine01 TS_USE_FAST_SDK
diff --git a/src/traffic_wccp/CMakeLists.txt b/src/traffic_wccp/CMakeLists.txt
new file mode 100644
index 0000000000..1a83912e58
--- /dev/null
+++ b/src/traffic_wccp/CMakeLists.txt
@@ -0,0 +1,20 @@
+#######################
+#
+# 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_executable(traffic_wccp wccp_client.cc)
+
+target_link_libraries(traffic_wccp PRIVATE tscore wccp)