${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")
")
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()