cmake: do not add -msse2/-msse3 globally
authorMike Gilbert <floppym@gentoo.org>
Fri, 29 Dec 2017 18:44:33 +0000 (13:44 -0500)
committerMike Gilbert <floppym@gentoo.org>
Fri, 29 Dec 2017 19:06:49 +0000 (14:06 -0500)
CMakeLists.txt
libfreerdp/CMakeLists.txt

index 9c13acd..d2f7385 100644 (file)
@@ -283,9 +283,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
                set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
        endif()
-       if(WITH_SSE2)
-               set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
-       endif()
 endif()
 
 # When building with Unix Makefiles and doing any release builds
@@ -310,9 +307,6 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-macros -Wno-padded")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-c11-extensions -Wno-gnu")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument")
-       if(WITH_SSE2)
-               set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3")
-       endif()
        CHECK_C_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarations)
        if(Wno-deprecated-declarations)
                set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
index fd65bb8..9516d9f 100644 (file)
@@ -145,7 +145,7 @@ set(CODEC_NEON_SRCS
 if(WITH_SSE2)
        set(CODEC_SRCS ${CODEC_SRCS} ${CODEC_SSE2_SRCS})
 
-       if(CMAKE_COMPILER_IS_GNUCC)
+       if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
                set_source_files_properties(${CODEC_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "-msse2" )
        endif()