From bc862577509b5b14e5fc2413425b7b0b09f17828 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 20 Jan 2015 23:27:08 -0800 Subject: Also support -xarch=sse_42 in the Sun C compiler for x86(-64). Change-Id: Ib6d0ae9c237b96568e2522d2077b311b3ac5af2e Reviewed-on: https://code.wireshark.org/review/6706 Reviewed-by: Guy Harris --- wsutil/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'wsutil/CMakeLists.txt') diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 0a8ed63acc..9a559e094f 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -77,14 +77,13 @@ set(WSUTIL_FILES ) # -# XXX - we're assuming MSVC supports the SSE 4.2 intrinsics and -# that other C compilers support them iff they support the -# -msse4.2 flag. +# XXX - we're assuming MSVC doesn't require a flag to enable SSE 4.2 +# support, and that, if the compiler supports a flag for SSE 4.2 +# support, the intrinsics are supported iff we can include the +# flag. # -# Perhaps we should check whether we can compile something -# that uses them, instead, and do something else to figure -# out what compiler flag, if any, we need to pass to the -# compiler to compile code that uses them. +# We only check for the GCC-style -msse4.2 flag and the Sun C +# -xarch=sse4_2 flag. # if(CMAKE_C_COMPILER_ID MATCHES "MSVC") set(HAVE_SSE4_2 TRUE) @@ -94,6 +93,12 @@ else() check_c_compiler_flag(-msse4.2 HAVE_SSE4_2) if(HAVE_SSE4_2) set(SSE4_2_FLAG "-msse4.2") + else() + message(STATUS "Checking for c-compiler flag: -xarch=sse4_2") + check_c_compiler_flag(-xarch=sse4_2 HAVE_SSE4_2) + if(HAVE_SSE4_2) + set(SSE4_2_FLAG "-xarch=sse4_2") + endif() endif() endif() if(HAVE_SSE4_2) -- cgit v1.2.1