--- caffe2/CMakeLists.txt.orig	2026-05-13 17:40:38 UTC
+++ caffe2/CMakeLists.txt
@@ -1,6 +1,8 @@ include(../cmake/Codegen.cmake)
 # ---[ Generate and install header and cpp files
 include(../cmake/Codegen.cmake)
 
+set(CMAKE_CXX_STANDARD 17)
+
 # ---[ Vulkan code gen
 if(USE_VULKAN)
   include(../cmake/VulkanCodegen.cmake)
@@ -483,7 +485,7 @@ endif()
 endif()
 
 # Enable conditional FP16 arithmetic intrinsics
-if(CPU_AARCH64 AND LINUX)
+if(CPU_AARCH64 AND CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 set_source_files_properties(${TORCH_ROOT}/aten/src/ATen/native/BlasKernel.cpp PROPERTIES COMPILE_FLAGS "-march=armv8.2-a+fp16")
 endif()
 
