diff options
Diffstat (limited to 'src/crypto/mac/CMakeLists.txt')
-rw-r--r-- | src/crypto/mac/CMakeLists.txt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/crypto/mac/CMakeLists.txt b/src/crypto/mac/CMakeLists.txt new file mode 100644 index 0000000..7f8664c --- /dev/null +++ b/src/crypto/mac/CMakeLists.txt @@ -0,0 +1,34 @@ +set(MACS "") + +if(WITH_MAC_GHASH) + list(APPEND MACS ghash) +endif(WITH_MAC_GHASH) + +set(MAC_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/macs.c") + +set(MAC_DEFINITIONS "") +set(MAC_IMPLS "") +set(MAC_LIST "") + +foreach(mac ${MACS}) + add_subdirectory(${mac}) + + list(APPEND MAC_SOURCES ${IMPL_SOURCES}) + + set(MAC_LIST "${MAC_LIST}\n{\"${MAC_NAME}\", mac_${mac}_impls},") + set(MAC_IMPLS "${MAC_IMPLS}\nstatic const fastd_mac_t *const mac_${mac}_impls[] = {") + + foreach(impl ${IMPLS}) + set(MAC_DEFINITIONS "${MAC_DEFINITIONS}\nextern const fastd_mac_t fastd_mac_${mac}_${impl};") + set(MAC_IMPLS "${MAC_IMPLS}&fastd_mac_${mac}_${impl}, ") + endforeach(impl) + + set(MAC_IMPLS "${MAC_IMPLS}NULL};") + +endforeach(mac) + + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macs.c.in ${CMAKE_CURRENT_BINARY_DIR}/macs.c) + + +set(MAC_SOURCES "${MAC_SOURCES}" PARENT_SCOPE) |