-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
55 lines (45 loc) · 1.34 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
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.2)
# Project Name
project (hacl)
# Build settings
set(CMAKE_BUILD_TYPE Release)
# Verified Files
set(SOURCE_FILES_VERIFIED
kremlib.c
FStar.c
Hacl_Policies.c
AEAD_Poly1305_64.c
Hacl_Chacha20.c
Hacl_Chacha20Poly1305.c
Hacl_Curve25519.c
Hacl_Ed25519.c
Hacl_Poly1305_64.c
Hacl_SHA2_256.c
Hacl_SHA2_384.c
Hacl_SHA2_512.c
Hacl_HMAC_SHA2_256.c
Hacl_Salsa20.c
NaCl.c)
# Experimental Files
set(SOURCE_FILES_EXPERIMENTAL
cpuid.c
drng.c
Random.c)
# Define a user variable to determinate if experimental files are build
option(Experimental "Include experimental code in HaCl build" OFF)
# Final set of files to build the libraries upon
if (Experimental)
set(SOURCE_FILES ${SOURCE_FILES_VERIFIED} ${SOURCE_FILES_EXPERIMENTAL})
else ()
set(SOURCE_FILES ${SOURCE_FILES_VERIFIED})
endif ()
# Compilation options
# set(CMAKE_C_FLAGS "-Wall -Wextra")
# Generate both a static and a shared library
add_library(hacl_static STATIC ${SOURCE_FILES})
set_target_properties(hacl_static PROPERTIES OUTPUT_NAME hacl)
add_library(hacl_shared SHARED ${SOURCE_FILES})
set_target_properties(hacl_shared PROPERTIES OUTPUT_NAME hacl)
# Note: on Windows, depending on the build system,
# both static and shared can have the .lib extension
# (You can change the OUTPUT_NAME in that case...)