-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
50 lines (34 loc) · 1.1 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.0.2)
project(seatuna C ASM)
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries.")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers.")
set(SO_MAJOR 1)
set(SO_MINOR 0)
set(SO_PATCH 0)
set(FULLVERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}")
find_package(cmocka REQUIRED)
enable_testing()
# TODO Remove -save-temps at some point.
add_compile_options(-std=gnu99 -save-temps -Wall -Wpedantic)
option(CHACHA20_DEFAULT "Use the default c chacha20 implementation.")
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
MESSAGE("Debug build.")
add_compile_options(-g)
ELSE()
MESSAGE("Release build.")
add_compile_options(-O2)
ENDIF()
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(bench)
add_subdirectory(src)
add_subdirectory(test)
add_library(seatuna SHARED ${lib_srcs})
set_target_properties(seatuna
PROPERTIES
VERSION "${FULL_VERSION}"
SOVERSION "${SO_MAJOR}"
)
install(TARGETS seatuna
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
)