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
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ 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)
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)")
Expand Down Expand Up @@ -150,6 +151,14 @@ if(TSMallocReplacement_FOUND)
link_libraries(ts::TSMallocReplacement)
endif()

if(ENABLE_UNWIND)
find_package(unwind)
if(unwind_FOUND)
link_libraries(unwind::unwind)
endif()
set(TS_USE_REMOTE_UNWINDING ${unwind_FOUND})
endif()

find_package(ZLIB REQUIRED)

include(Check128BitCas)
Expand Down
49 changes: 49 additions & 0 deletions cmake/Findunwind.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.
#
#######################

# Findunwind.cmake
#
# This will define the following variables
#
# unwind_FOUND
# unwind_LIBRARY
# unwind_INCLUDE_DIRS
#
# and the following imported targets
#
# unwind::unwind
#

find_library(unwind_LIBRARY NAMES unwind)
find_path(unwind_INCLUDE_DIR NAMES unwind.h)

mark_as_advanced(unwind_FOUND unwind_LIBRARY unwind_INCLUDE_DIR)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(unwind
REQUIRED_VARS unwind_LIBRARY unwind_INCLUDE_DIR
)

if(unwind_FOUND)
set(unwind_INCLUDE_DIRS ${unwind_INCLUDE_DIR})
endif()

if(unwind_FOUND AND NOT TARGET unwind::unwind)
add_library(unwind::unwind INTERFACE IMPORTED)
target_include_directories(unwind::unwind INTERFACE ${unwind_INCLUDE_DIRS})
target_link_libraries(unwind::unwind INTERFACE "${unwind_LIBRARY}")
endif()
1 change: 1 addition & 0 deletions include/tscore/ink_config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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_REMOTE_UNWINDING
#cmakedefine01 TS_USE_SET_RBIO
#cmakedefine01 TS_USE_TLS13

Expand Down