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

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

cmake: Add mips2 compile options

---

Modified: cmake/compiler-specific.cmake

---

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

---

diff --git a/cmake/compiler-specific.cmake b/cmake/compiler-specific.cmake
index d2e45f0028f..70109b26e87 100644
--- a/cmake/compiler-specific.cmake
+++ b/cmake/compiler-specific.cmake
@@ -288,7 +288,26 @@ elseif(TARGET_ARCH STREQUAL "mips")
   else()
     message(WARNING "Unsupported compiler (${CMAKE_C_COMPILER_ID}) for mips. 
Try GCC.")
   endif()
-
+elseif(TARGET_ARCH STREQUAL "mips2")
+  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 -ftree-vectorize 
-fno-strict-overflow)
+    elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.0)
+      target_compile_options(common_compiler_flags INTERFACE -ftree-vectorize)
+    elseif(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.0)
+      message(
+        WARNING
+          "You are using an old and unsupported gcc version 
${CMAKE_C_COMPILER_VERSION}, compile at your own risk!"
+      )
+    endif()
+  else()
+    message(
+      WARNING
+        "Unsupported compiler (${CMAKE_C_COMPILER_ID}) for ${TARGET_ARCH}. Try 
GCC. Compile at your own risk!"
+    )
+  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