Browse Source

Fix cmake build on macOS (#949)

macOS does not have `pthread_barrier_*` so need to define `TURN_NO_THREAD_BARRIERS` as a workaround

Fixes #946 

Tests plan: 
- run cmake to generate make files
- run make to build turnserver
- run `examples/run_tests.sh` and pass successfully
Pavel Punsky 3 years ago
parent
commit
7a38f02699
1 changed files with 4 additions and 0 deletions
  1. 4 0
      CMakeLists.txt

+ 4 - 0
CMakeLists.txt

@@ -55,6 +55,10 @@ IF(MSVC)
     add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
 ENDIF(MSVC)
 
+IF(APPLE)
+    add_compile_definitions("TURN_NO_THREAD_BARRIERS=1")
+ENDIF()
+
 include(CMakePackageConfigHelpers)
 include(GNUInstallDirs)
 include(GenerateExportHeader)