aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/AsmOp.cmake
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 13:49:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-06 13:49:17 +0000
commit82f9e6dff521cd21d7d00939a8093ad00197c61b (patch)
tree3d644d389b999913683dbce608aadd7191c6fe93 /src/libcryptobox/AsmOp.cmake
parent60228b266bd9a130e810589abacc2acae9480644 (diff)
downloadrspamd-82f9e6dff521cd21d7d00939a8093ad00197c61b.tar.gz
rspamd-82f9e6dff521cd21d7d00939a8093ad00197c61b.zip
Add optimized versions of ChaCha20 by @floodyberry
Diffstat (limited to 'src/libcryptobox/AsmOp.cmake')
-rw-r--r--src/libcryptobox/AsmOp.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libcryptobox/AsmOp.cmake b/src/libcryptobox/AsmOp.cmake
new file mode 100644
index 000000000..a0d8b1377
--- /dev/null
+++ b/src/libcryptobox/AsmOp.cmake
@@ -0,0 +1,21 @@
+# Check for assembler option specified
+
+function(asm_op output_var op description)
+ SET(asm_code "
+ ${op}
+ ")
+ file(WRITE "${CMAKE_BINARY_DIR}/asm.S" "${asm_code}")
+ try_compile(HAVE_OP
+ "${CMAKE_BINARY_DIR}"
+ "${CMAKE_BINARY_DIR}/asm.S"
+ CMAKE_FLAGS "-DCMAKE_ASM_LINK_EXECUTABLE='echo not linking now...'")
+ #file(REMOVE "${CMAKE_BINARY_DIR}/asm.s")
+
+ if(HAVE_OP)
+ MESSAGE(STATUS "Compilation of ${description} asm set is supported")
+ else()
+ MESSAGE(STATUS "Compilation of ${description} asm set is -NOT- supported")
+ endif()
+
+ set(${output_var} "${HAVE_OP}" PARENT_SCOPE)
+endfunction()