This is an automated email from the ASF dual-hosted git repository.

cmcfarlen 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 21b2e87a53 Fix freebsd ci build (#10632)
21b2e87a53 is described below

commit 21b2e87a5301809e4a4f17f3dd0cbf111524d16f
Author: Chris McFarlen <ch...@mcfarlen.us>
AuthorDate: Tue Oct 17 15:48:40 2023 -0500

    Fix freebsd ci build (#10632)
    
    * Link backtrace libraries if any are found
    
    * link libswoc even without brotli
    
    ---------
    
    Co-authored-by: Chris McFarlen <cmcfar...@apple.com>
---
 CMakeLists.txt                  | 3 +++
 plugins/compress/CMakeLists.txt | 3 ++-
 src/tscore/CMakeLists.txt       | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c339d7979..2b88568d8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -260,6 +260,9 @@ check_include_file(endian.h HAVE_ENDIAN_H)
 find_package(Backtrace)
 if(Backtrace_FOUND)
   set(TS_HAS_BACKTRACE TRUE)
+  if(Backtrace_LIBRARIES)
+    message(STATUS "Backtrace found (library ${Backtrace_LIBRARIES})")
+  endif()
 endif()
 
 find_package(brotli)
diff --git a/plugins/compress/CMakeLists.txt b/plugins/compress/CMakeLists.txt
index 17bd8e7d97..63d80cf2e2 100644
--- a/plugins/compress/CMakeLists.txt
+++ b/plugins/compress/CMakeLists.txt
@@ -16,6 +16,7 @@
 #######################
 
 add_atsplugin(compress compress.cc configuration.cc misc.cc)
+target_link_libraries(compress PRIVATE libswoc)
 if(HAVE_BROTLI_ENCODE_H)
-  target_link_libraries(compress PRIVATE brotli::brotlienc libswoc)
+  target_link_libraries(compress PRIVATE brotli::brotlienc)
 endif()
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index ea72a796d7..f77f054f36 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -120,6 +120,10 @@ if(TS_USE_HWLOC)
   target_link_libraries(tscore PUBLIC hwloc::hwloc)
 endif()
 
+if(Backtrace_LIBRARIES)
+  target_link_libraries(tscore PRIVATE ${Backtrace_LIBRARIES})
+endif()
+
 add_dependencies(tscore ParseRules)
 target_include_directories(tscore PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
 if(TS_HAS_128BIT_CAS AND TS_NEEDS_MCX16_FOR_CAS)

Reply via email to