diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 15:51:16 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-08 15:51:16 +0100 |
commit | e95ca5c778fb9dd0969c842ec57389025a9db913 (patch) | |
tree | 151b005ca918017106ddb263658a2edee1cfffe4 /src/libcryptobox/AsmOp.cmake | |
parent | 5f593737d534de847747a641c75f70b608ae5d74 (diff) | |
download | rspamd-e95ca5c778fb9dd0969c842ec57389025a9db913.tar.gz rspamd-e95ca5c778fb9dd0969c842ec57389025a9db913.zip |
Rework cmake caching.
Diffstat (limited to 'src/libcryptobox/AsmOp.cmake')
-rw-r--r-- | src/libcryptobox/AsmOp.cmake | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/libcryptobox/AsmOp.cmake b/src/libcryptobox/AsmOp.cmake index a0d8b1377..bcf9d996a 100644 --- a/src/libcryptobox/AsmOp.cmake +++ b/src/libcryptobox/AsmOp.cmake @@ -1,21 +1,19 @@ # 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() +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() |