Module: kamailio
Branch: master
Commit: 9d6d4f66c586396def5bbf9b8cf59d277983c72e
URL: 
https://github.com/kamailio/kamailio/commit/9d6d4f66c586396def5bbf9b8cf59d277983c72e

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2025-08-14T14:56:52Z

cmake: Add futex definition to linux.

- Match existing behavior with makefiles
- This has the side effect that both fast_lock and use_futex are defined.
- code selects use_futex

---

Modified: cmake/os-specific/linux.cmake

---

Diff:  
https://github.com/kamailio/kamailio/commit/9d6d4f66c586396def5bbf9b8cf59d277983c72e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9d6d4f66c586396def5bbf9b8cf59d277983c72e.patch

---

diff --git a/cmake/os-specific/linux.cmake b/cmake/os-specific/linux.cmake
index a769567a02f..b55603cefab 100644
--- a/cmake/os-specific/linux.cmake
+++ b/cmake/os-specific/linux.cmake
@@ -51,4 +51,13 @@ if(NOT NO_SIGIO_RT)
   target_compile_definitions(common INTERFACE HAVE_SIGIO_RT 
SIGINFO64_WORKAROUND)
 endif()
 
-# TODO introduce check for futex
+# TODO This is placed here to match the Makefiles where both
+# FAST_LOCK and USE_FUTEX are defined unconditionally.
+# This also had the side effect that futex also uses the definitions
+# defined for FAST_LOCK like ADAPTIVE_WAIT[_LOOPS].
+# https://github.com/kamailio/kamailio/pull/4363 aims to fix this
+# and we should decide whether to also apply the definitions for USE_FUTEX 
case.
+find_path(FUTEX_HEADER_DIR linux/futex.h)
+if(FUTEX_HEADER_DIR)
+  target_compile_definitions(common INTERFACE USE_FUTEX)
+endif()

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to