summaryrefslogtreecommitdiffstats
path: root/cmake/AsmOp.cmake
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-15 11:58:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-15 11:58:43 +0000
commitc15ca59b25403a3d6a3d9383f2dabf4b8d419876 (patch)
treed39c367b205dfb9c033ba4692c9af2a790db587c /cmake/AsmOp.cmake
parent526c3aedfcc17353fab76dfd3a4f393264b3bc2f (diff)
downloadrspamd-c15ca59b25403a3d6a3d9383f2dabf4b8d419876.tar.gz
rspamd-c15ca59b25403a3d6a3d9383f2dabf4b8d419876.zip
[Rework] Move cmake modules to a dedicated path
Diffstat (limited to 'cmake/AsmOp.cmake')
-rw-r--r--cmake/AsmOp.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/AsmOp.cmake b/cmake/AsmOp.cmake
new file mode 100644
index 000000000..bcf9d996a
--- /dev/null
+++ b/cmake/AsmOp.cmake
@@ -0,0 +1,19 @@
+# Check for assembler option specified
+
+MACRO(asm_op output_var description)
+ IF(NOT ${output_var})
+ 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...'")
+
+ 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}" CACHE INTERNAL "${description}")
+ ENDIF()
+ENDMACRO()