-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
33 lines (23 loc) · 1.03 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project(AUTHENC C ASM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Werror -Wno-error=unused-function -D_POSIX_C_SOURCE=199309L")
include_directories("include")
set(BACKEND "ref" CACHE STRING "Backend to use.")
file(GLOB LIB_SRCS "src/*.c")
file(GLOB_RECURSE BACKEND_SRCS "src/${BACKEND}/*.c" "src/${BACKEND}/*.S" "src/${BACKEND}/*.s")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/${BACKEND}/CMakeLists.txt")
add_subdirectory("src/${BACKEND}/")
endif()
list(APPEND LIB_SRCS ${BACKEND_SRCS})
add_library(authenc ${LIB_SRCS})
enable_testing()
add_executable(test_bc_aes test/test_bc_aes.c)
target_link_libraries(test_bc_aes authenc)
add_executable(test_sc_aesctr test/test_sc_aesctr.c)
target_link_libraries(test_sc_aesctr authenc)
add_executable(test_ac_gcm test/test_ac_gcm.c)
target_link_libraries(test_ac_gcm authenc)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/bench/authenc_bench.c")
add_executable(bench_ac_gcm bench/bench_ac_gcm.c bench/authenc_bench.c)
target_link_libraries(bench_ac_gcm authenc)
endif()