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

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <x...@gilawa.com>
Date: 2025-08-26T11:18:00Z

cmake: Add mips compile options

---

Modified: cmake/compiler-specific.cmake

---

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

---

diff --git a/cmake/compiler-specific.cmake b/cmake/compiler-specific.cmake
index 415cc1ffb4a..d2e45f0028f 100644
--- a/cmake/compiler-specific.cmake
+++ b/cmake/compiler-specific.cmake
@@ -269,6 +269,26 @@ elseif(TARGET_ARCH STREQUAL "sparc")
   else()
     message(FATAL_ERROR "Unsupported compiler (${CMAKE_C_COMPILER_ID}) for 
sparc. Try GCC or Sun.")
   endif()
+elseif(TARGET_ARCH STREQUAL "mips")
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    target_compile_definitions(common_compiler_flags INTERFACE CC_GCC_LIKE_ASM)
+    target_compile_options(common_compiler_flags INTERFACE -funroll-loops)
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.2)
+      target_compile_options(
+        common_compiler_flags INTERFACE -mfp32 -march=r3000 -ftree-vectorize 
-fno-strict-overflow
+      )
+    elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.0)
+      target_compile_options(common_compiler_flags INTERFACE -march=r3000 
-ftree-vectorize)
+    else()
+      message(
+        WARNING "GCC version ${CMAKE_C_COMPILER_VERSION} is too old for mips. 
Try GCC 4.0 or newer."
+      )
+    endif()
+
+  else()
+    message(WARNING "Unsupported compiler (${CMAKE_C_COMPILER_ID}) for mips. 
Try GCC.")
+  endif()
+
 else()
   message(
     WARNING

_______________________________________________
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