]> source.dussan.org Git - rspamd.git/commitdiff
128 bit integers are not very portable.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 12:14:49 +0000 (13:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 12:14:49 +0000 (13:14 +0100)
src/libcryptobox/CMakeLists.txt

index ccdfba279ce1525abdfa9fff15741fb3db70cde4..3579ebc1a3c56470d007e3698f2cdffdb46c4b87 100644 (file)
@@ -13,7 +13,7 @@ SET(CURVESRC ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/ref.c
                ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519.c)
 
 # For now we support only x86_64 architecture with optimizations
-IF(${ARCH} STREQUAL "x86_64")
+IF("${ARCH}" STREQUAL "x86_64")
        SET(ASM_CODE "vpaddq %ymm0, %ymm0, %ymm0")
        ASM_OP(HAVE_AVX2 "avx2")
        SET(ASM_CODE "vpaddq %xmm0, %xmm0, %xmm0")
@@ -43,9 +43,15 @@ IF(${ARCH} STREQUAL "x86_64")
        ")
        ASM_OP(HAVE_DOLLARMACRO "dollar macro convention")
 
-       SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-64.c)
-       SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna-c64.c)
-ELSEIF(${ARCH} STREQUAL "i386")
+       if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+               SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-64.c)
+               SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna-c64.c)
+       else()
+               SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-32.c)
+               SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna.c)
+       endif()
+
+ELSEIF("${ARCH}" STREQUAL "i386")
        SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-32.c)
        SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna.c)
 ELSE()