From 4636f2a6870dc7b74ce16854c32d51fc976436a9 Mon Sep 17 00:00:00 2001 From: loctormor Date: Thu, 16 Jul 2026 16:49:48 -0400 Subject: [PATCH 1/2] Remove ARROW_SSE4_2_FLAG for x86 MSVC The SSE4.2 flag is invalid in for the MSVC x86 compiler. https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86 --- cpp/cmake_modules/SetupCxxFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake index 21341167fe9..11e616cb094 100644 --- a/cpp/cmake_modules/SetupCxxFlags.cmake +++ b/cpp/cmake_modules/SetupCxxFlags.cmake @@ -49,7 +49,7 @@ endif() if(ARROW_CPU_FLAG STREQUAL "x86") # x86/amd64 compiler flags, msvc/gcc/clang if(MSVC) - set(ARROW_SSE4_2_FLAG "/arch:SSE4.2") + set(ARROW_SSE4_2_FLAG "") # These definitions are needed for xsimd to consider the corresponding instruction # sets available, but they are not set by MSVC (unlike other compilers). # See https://github.com/AcademySoftwareFoundation/OpenImageIO/issues/4265 From e8b11507e81d6c8073625f50c0ba19ea56524674 Mon Sep 17 00:00:00 2001 From: loctormor Date: Fri, 24 Jul 2026 12:06:56 -0400 Subject: [PATCH 2/2] Add comments to justify SSE4.2 omission Removed '/arch:SSE4.2' flag on all MSVC builds to avoid D9002 warnings. --- cpp/cmake_modules/SetupCxxFlags.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake index 11e616cb094..a6a4f65472c 100644 --- a/cpp/cmake_modules/SetupCxxFlags.cmake +++ b/cpp/cmake_modules/SetupCxxFlags.cmake @@ -49,6 +49,9 @@ endif() if(ARROW_CPU_FLAG STREQUAL "x86") # x86/amd64 compiler flags, msvc/gcc/clang if(MSVC) + # The "/arch:SSE4.2" flag is not supported in x86 builds and is + # enabled by default in x64. Removed to avoid D9002 nuisance warnings. + # See https://learn.microsoft.com/cpp/build/reference/arch-x86 set(ARROW_SSE4_2_FLAG "") # These definitions are needed for xsimd to consider the corresponding instruction # sets available, but they are not set by MSVC (unlike other compilers).