--- CMakeLists.txt.orig	2021-12-17 13:50:15 UTC
+++ CMakeLists.txt
@@ -17,7 +17,7 @@ if( PROJECT_VERSION_RC)
     set( PROJECT_VERSION "${PROJECT_VERSION}-rc${PROJECT_VERSION_RC}" )
 endif()
 
-set( VVDEC_ENABLE_X86_SIMD TRUE  CACHE BOOL "enable x86 intrinsics" )
+set( VVDEC_ENABLE_X86_SIMD ${FREEBSD_VVDEC_ENABLE_X86_SIMD}  CACHE BOOL "enable x86 intrinsics" )
 set( VVDEC_ENABLE_ARM_SIMD FALSE CACHE BOOL "enable arm intrinsics" )
 
 if( APPLE )
@@ -42,7 +42,7 @@ endif()
 # enable sse4.1 build for all source files for gcc and clang
 if( VVDEC_ENABLE_X86_SIMD )
   if( UNIX OR MINGW )
-    add_compile_options( "-msse4.1" )
+    add_compile_options( ${FREEBSD_SIMD_CFLAGS} )
   endif()
 
   set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTARGET_SIMD_X86" )
