summaryrefslogtreecommitdiffstats
path: root/src/methods/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/methods/CMakeLists.txt')
-rw-r--r--src/methods/CMakeLists.txt13
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)