summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
blob: 0fb0ebd7a1975f6b5e513a18497b31af541d0579 (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
27
28
29
30
31
32
33
34
35
36
37
set(METHODS method_null.c)

if(WITH_METHOD_XSALSA20_POLY1305)
  list(APPEND METHODS method_xsalsa20_poly1305.c)
endif(WITH_METHOD_XSALSA20_POLY1305)

if(WITH_METHOD_AES128_GCM)
  list(APPEND METHODS method_aes128_gcm.c)
endif(WITH_METHOD_AES128_GCM)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FASTD_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CAP_INCLUDE_DIR} ${UECC_INCLUDE_DIRS} ${NACL_INCLUDE_DIR})
link_directories(${UECC_LIBRARY_DIRS})

FLEX_TARGET(fastd_config_lex config.l ${CMAKE_CURRENT_BINARY_DIR}/config.ll.c)
BISON_TARGET(fastd_config_parse config.y ${CMAKE_CURRENT_BINARY_DIR}/config.yy.c)

add_executable(fastd
  fastd.c
  config.c
  crypto.c
  crypto_linux.c
  handshake.c
  peer.c
  printf.c
  queue.c
  random.c
  resolve.c
  task.c
  protocol_ec25519_fhmqvc.c
  ${FLEX_fastd_config_lex_OUTPUTS}
  ${BISON_fastd_config_parse_OUTPUTS}
  ${METHODS}
)
set_target_properties(fastd PROPERTIES COMPILE_FLAGS -pthread ${UECC_CFLAGS_OTHER} LINK_FLAGS -pthread ${UECC_LDFLAGS_OTHER})
target_link_libraries(fastd rt ${CAP_LIBRARY} ${UECC_LIBRARIES} ${NACL_LIBRARY})

install(TARGETS fastd RUNTIME DESTINATION bin)