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 d416614d02 Cmake freebsd fix (#10631)
d416614d02 is described below

commit d416614d026988224199d398e3cbebcec7b39efe
Author: Chris McFarlen <ch...@mcfarlen.us>
AuthorDate: Tue Oct 17 12:28:38 2023 -0500

    Cmake freebsd fix (#10631)
    
    * add freebsd specific section with pthread
    
    * cleanup
    
    ---------
    
    Co-authored-by: Chris McFarlen <cmcfar...@apple.com>
---
 CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42236f369a..4c339d7979 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -507,6 +507,15 @@ if(HOST_OS STREQUAL "darwin")
   set(CMAKE_MACOSX_RPATH 1)
 endif(HOST_OS STREQUAL "darwin")
 
+if(HOST_OS STREQUAL "freebsd")
+  set(CMAKE_THREAD_LIBS_INIT "-lpthread")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+  set(CMAKE_HAVE_THREADS_LIBRARY 1)
+  set(CMAKE_USE_WIN32_THREADS_INIT 0)
+  set(CMAKE_USE_PTHREADS_INIT 1)
+  set(THREADS_PREFER_PTHREAD_FLAG ON)
+endif()
+
 # Set the rpath for installed binaries
 set(CMAKE_INSTALL_RPATH 
"${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64")
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

Reply via email to