Skip to content

Commit 1d300df

Browse files
committed
STYLE: Remove unused SSE2 compiler flag checks in CMake configuration
Visual Studio 2022 warns of ignored flags. In Visual Studio 2012 and later versions, SSE2 is enabled by default. https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86?view=msvc-170 Originally prompted by 1000's of warnings: cl : Command line warning D9025 : overriding '/arch:SSE' with '/arch:SSE2' For all modern Linux packaging workflows (wheels, C++ libs, distros): x86_64: do NOT specify -msse2 — wasteful and redundant. Portability is retained, the x86-64 baseline includes SSE2
1 parent c3e1e02 commit 1d300df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMake/ITKSetStandardCompilerFlags.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ macro(check_compiler_platform_flags)
446446
)
447447
endif()
448448

449-
check_sse2_flags(ITK_SSE2_CFLAGS_IF_AVAILABLE)
449+
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
450+
# Setting sse2 flags only make sense on 32 bit architectures
451+
# on 64bit systems, sse2 support is required, and compiler support is defaulted
452+
check_sse2_flags(ITK_SSE2_CFLAGS_IF_AVAILABLE)
453+
endif()
450454
set(
451455
ITK_REQUIRED_CXX_FLAGS
452456
"${ITK_REQUIRED_CXX_FLAGS} ${ITK_SSE2_CFLAGS_IF_AVAILABLE}"

0 commit comments

Comments
 (0)