summaryrefslogtreecommitdiffstats
path: root/src/methods/CMakeLists.txt
blob: 3ef410b58ad43dfedf9f1abae49a7a0d8b6f3ade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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_SOURCES "")

foreach(method ${METHODS})
  add_subdirectory(${method})
  list(APPEND METHOD_SOURCES $<TARGET_OBJECTS:method_${method}>)
endforeach(method)

if(METHOD_COMMON)
  list(APPEND METHOD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/common.c)
endif(METHOD_COMMON)

set(METHOD_SOURCES "${METHOD_SOURCES}" PARENT_SCOPE)