Define GCC pragmas only for GCC compiler

This commit is contained in:
Klemen Kozjek 2017-09-25 10:49:17 +09:00
parent 5083bef59f
commit 616815fc8e
2 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,10 @@ if(UNIX)
add_definitions(-D_FILE_OFFSET_BIT=64)
endif()
if (CMAKE_C_COMPILER MATCHES ".*clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse3 -msse4.1 -maes")
endif ()
# create minizip library
add_library(minizip ${MINIZIP_SRC} ${MINIZIP_PUBLIC_HEADERS})
target_link_libraries(minizip ZLIB::ZLIB)

View File

@ -42,9 +42,13 @@ INLINE int has_aes_ni(void)
#elif defined( __GNUC__ )
#include <cpuid.h>
#if !defined(__clang__)
#pragma GCC target ("ssse3")
#pragma GCC target ("sse4.1")
#pragma GCC target ("aes")
#endif
#include <x86intrin.h>
#define INLINE static __inline