diff --git a/CMakeLists.txt b/CMakeLists.txt index 691ac7d393e..765cdbeb665 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 8ae1dcc9453..3075dc43f47 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 00000000000..1a83912e587 --- /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)