diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-10-28 18:27:10 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-10-28 18:31:02 +0100 |
commit | fc8c8d82f05911836208cc9169e103d5578ffd70 (patch) | |
tree | 06aad5eebfa87982ae95a76bb5644161fc73c6df /src/methods/CMakeLists.txt | |
parent | 095ca93d81cfae0fcb137919231810577c556404 (diff) | |
download | fastd-fc8c8d82f05911836208cc9169e103d5578ffd70.tar fastd-fc8c8d82f05911836208cc9169e103d5578ffd70.zip |
Unify duplicate code in xsalsa20-poly1305 and aes128-gcm methods
Diffstat (limited to 'src/methods/CMakeLists.txt')
-rw-r--r-- | src/methods/CMakeLists.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/methods/CMakeLists.txt b/src/methods/CMakeLists.txt index 55f41d2..3ef410b 100644 --- a/src/methods/CMakeLists.txt +++ b/src/methods/CMakeLists.txt @@ -1,19 +1,26 @@ set(METHODS null) +set(METHOD_COMMON FALSE) if(WITH_METHOD_XSALSA20_POLY1305) list(APPEND METHODS xsalsa20_poly1305) + set(METHOD_COMMON TRUE) endif(WITH_METHOD_XSALSA20_POLY1305) if(WITH_METHOD_AES128_GCM) list(APPEND METHODS aes128_gcm) + set(METHOD_COMMON TRUE) endif(WITH_METHOD_AES128_GCM) -set(METHOD_OBJECTS "") +set(METHOD_SOURCES "") foreach(method ${METHODS}) add_subdirectory(${method}) - list(APPEND METHOD_OBJECTS $<TARGET_OBJECTS:method_${method}>) + list(APPEND METHOD_SOURCES $<TARGET_OBJECTS:method_${method}>) endforeach(method) -set(METHOD_OBJECTS "${METHOD_OBJECTS}" PARENT_SCOPE) +if(METHOD_COMMON) + list(APPEND METHOD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/common.c) +endif(METHOD_COMMON) + +set(METHOD_SOURCES "${METHOD_SOURCES}" PARENT_SCOPE) |