diff -Naur xevd-0.5.0.old/CMakeLists.txt xevd-0.5.0/CMakeLists.txt
--- xevd-0.5.0.old/CMakeLists.txt	2025-09-08 17:02:37.227878934 +0200
+++ xevd-0.5.0/CMakeLists.txt	2025-09-08 17:03:59.232785118 +0200
@@ -105,8 +105,7 @@
         set(OPT_DBG "-DNDEBUG") # disable assert
     endif()
 
-    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -${OPT_LV} ${OPT_DBG} -fomit-frame-pointer -Wall -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-attributes -Werror -Wno-unknown-pragmas -Wno-stringop-overflow -std=c99")
-    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-sign -pthread -Wno-pointer-to-int-cast -Wno-maybe-uninitialized")
+    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -${OPT_LV} ${OPT_DBG} -Wall -pthread -std=c99")
     set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm")
 endif()
 
@@ -134,6 +133,18 @@
     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 endif()
 
+# To build for arm provide in command line: -DARM=TRUE
+if(NOT ARM)
+  set(ARM "FALSE")
+else()
+  add_definitions(-DARM=1)
+  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flax-vector-conversions")
+  if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+    set(CMAKE_EXE_LINKER_FLAGS "-static")
+  endif()
+endif()
+message("ARM=${ARM}")
+
 ########################################
 # add CPack to project
 ########################################
diff -Naur xevd-0.5.0.old/src_base/CMakeLists.txt xevd-0.5.0/src_base/CMakeLists.txt
--- xevd-0.5.0.old/src_base/CMakeLists.txt	2025-09-08 17:02:37.230545819 +0200
+++ xevd-0.5.0/src_base/CMakeLists.txt	2025-09-08 17:02:46.122035862 +0200
@@ -15,14 +15,26 @@
 
 include(GenerateExportHeader)
 include_directories("${CMAKE_BINARY_DIR}")
+
+set(ARM "FALSE")
+message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)")
+  set(ARM "TRUE")
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)")
+  set(X86 "TRUE")
+endif()
+
 if("${ARM}" STREQUAL "TRUE")
     add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC} )
     add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_NEON_SRC} ${LIB_NEON_INC} )
-else()
+elseif(X86)
     add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC}
                                        ${LIB_AVX_SRC} ${LIB_AVX_INC} )
     add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_SSE_SRC} ${LIB_SSE_INC}
                                                ${LIB_AVX_SRC} ${LIB_AVX_INC} )
+else()
+    add_library( ${LIB_NAME_BASE} STATIC ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} )
+    add_library( ${LIB_NAME_BASE}_dynamic SHARED ${LIB_API_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} )
 endif()
 
 set_target_properties(${LIB_NAME_BASE}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION})
@@ -56,8 +68,10 @@
 
 if("${ARM}" STREQUAL "TRUE")
     include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./neon)
-else()
+elseif(X86)
     include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc ./sse ./avx)
+else()
+    include_directories( ${LIB_NAME_BASE} PUBLIC . .. ../inc)
 endif()
 
 
@@ -86,7 +100,11 @@
                             ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/import/lib)
 elseif( UNIX OR MINGW )
 
-    if("${ARM}" STREQUAL "FALSE")
+    if(ARM)
+        add_definitions(-DARM=1)
+        set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions")
+    elseif(X86)
+        add_definitions(-DX86=1)
         set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" )
         set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" )
     endif()
diff -Naur xevd-0.5.0.old/src_base/xevd_def.h xevd-0.5.0/src_base/xevd_def.h
--- xevd-0.5.0.old/src_base/xevd_def.h	2025-09-08 17:02:37.232878979 +0200
+++ xevd-0.5.0/src_base/xevd_def.h	2025-09-08 17:02:46.122168051 +0200
@@ -1498,7 +1498,7 @@
 #include "xevd_mc.h"
 #include "xevd_eco.h"
 #include "xevd_df.h"
-#ifndef ARM
+#if defined(X86)
 #include "xevd_mc_sse.h"
 #include "xevd_mc_avx.h"
 #include "xevd_itdq_sse.h"
@@ -1506,7 +1506,7 @@
 #include "xevd_recon_avx.h"
 #include "xevd_recon_sse.h"
 #include "xevd_dbk_sse.h"
-#else
+#elif defined(ARM)
 #include "xevd_mc_neon.h"
 #include "xevd_itdq_neon.h"
 #include "xevd_recon_neon.h"
diff -Naur xevd-0.5.0.old/src_base/xevd_port.h xevd-0.5.0/src_base/xevd_port.h
--- xevd-0.5.0.old/src_base/xevd_port.h	2025-09-08 17:02:37.234878997 +0200
+++ xevd-0.5.0/src_base/xevd_port.h	2025-09-08 17:02:46.122306953 +0200
@@ -137,10 +137,10 @@
 #define xevd_assert_gv(x,r,v,g) \
     {if(!(x)){assert(x); (r)=(v); goto g;}}
 
-#ifndef ARM
+#if defined(X86)
 #define X86_SSE                 1
 #define ARM_NEON                0
-#else
+#elif defined(ARM)
 #define X86_SSE                 0
 #define ARM_NEON                1
 #endif
diff -Naur xevd-0.5.0.old/src_main/CMakeLists.txt xevd-0.5.0/src_main/CMakeLists.txt
--- xevd-0.5.0.old/src_main/CMakeLists.txt	2025-09-08 17:02:37.235879006 +0200
+++ xevd-0.5.0/src_main/CMakeLists.txt	2025-09-08 17:02:46.122402222 +0200
@@ -27,16 +27,27 @@
 include(GenerateExportHeader)
 include_directories("${CMAKE_BINARY_DIR}")
 
+set(ARM "FALSE")
+message("SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(arm|aarch)")
+  set(ARM "TRUE")
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86|ia64|i386|i686)")
+  set(X86 "TRUE")
+endif()
+
 if("${ARM}" STREQUAL "TRUE")
     add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} 
                                     ${LIB_NEON_SRC} ${LIB_NEON_INC} ${LIB_MAIN_NEON_SRC} ${LIB_MAIN_NEON_INC} )
     add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} 
                                     ${LIB_NEON_SRC} ${LIB_NEON_INC} ${LIB_MAIN_NEON_SRC} ${LIB_MAIN_NEON_INC} )
-else()
+elseif(X86)
     add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC}
                                     ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC} )
     add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC}
                                             ${LIB_SSE_SRC} ${LIB_SSE_INC} ${LIB_MAIN_SSE_SRC} ${LIB_MAIN_SSE_INC} ${LIB_AVX_SRC} ${LIB_AVX_INC} ${LIB_MAIN_AVX_SRC} ${LIB_MAIN_AVX_INC} )
+else()
+    add_library( ${LIB_NAME} STATIC ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} )
+    add_library( ${LIB_NAME}_dynamic SHARED ${LIB_API_MAIN_SRC} ${XEVD_INC} ${LIB_BASE_SRC} ${LIB_BASE_INC} ${LIB_MAIN_SRC} ${LIB_MAIN_INC} )
 endif()
 
 set_target_properties(${LIB_NAME}_dynamic PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${LIB_SOVERSION})
@@ -79,12 +90,15 @@
 
 if("${ARM}" STREQUAL "TRUE")
     include_directories( ${LIB_NAME} PUBLIC . .. ../inc ./neon ../src_base ../src_base/neon)
-else()
+elseif(X86)
     include_directories( ${LIB_NAME} PUBLIC . .. ../inc ./sse ./avx ../src_base ../src_base/sse ../src_base/avx)
+else()
+    include_directories( ${LIB_NAME} PUBLIC . .. ../inc ../src_base)
 endif()
 
 set( SSE ${BASE_INC_FILES} ${LIB_SSE_SRC} ${LIB_MAIN_SSE_SRC})
 set( AVX ${LIB_AVX_SRC} ${LIB_MAIN_AVX_SRC})
+set( NEON ${LIB_NEON_SRC} ${LIB_MAIN_NEON_SRC})
 
 set_target_properties(${LIB_NAME}_dynamic PROPERTIES OUTPUT_NAME ${LIB_NAME})
 
@@ -101,7 +115,11 @@
     set_target_properties(${LIB_NAME}_dynamic PROPERTIES FOLDER lib
                             ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR}/import/lib)
 elseif( UNIX OR MINGW )
-    if("${ARM}" STREQUAL "FALSE")
+    if(ARM)
+        add_definitions(-DARM=1)
+        set_property( SOURCE ${NEON} APPEND PROPERTY COMPILE_FLAGS "-flax-vector-conversions")
+    elseif(X86)
+        add_definitions(-DX86=1)
         set_property( SOURCE ${SSE} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" )
         set_property( SOURCE ${AVX} APPEND PROPERTY COMPILE_FLAGS " -mavx2" )
     endif()
