-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
115 lines (105 loc) · 2.13 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
project(darling-corecrypto)
add_compile_options(
-Wno-return-type
)
add_definitions(
-DDEBUG
-D_FILE_OFFSET_BITS=64
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
)
set(corecrypto_sources
src/cc.c
src/ccdigest.c
src/ccmd2.c
src/ccmd4.c
src/ccmd5.c
src/ccder.c
src/ccec.c
src/ccdh.c
src/ccdh_gp.c
src/ccaes.c
src/ccsha2xx.c
src/ccsha3xx.c
src/cczp.c
src/ccsha1.c
src/ccrsa.c
src/ccrng.c
src/ccrng_system.c
src/ccrc4.c
src/ccn.c
src/ccmode.c
src/ccdes.c
src/ccrsa_priv.c
src/cccast.c
src/ccrc2.c
src/ccblowfish.c
src/ccnistkdf.c
src/ccz.c
src/cccmac.c
src/ccripemd.c
src/cchkdf.c
src/cchmac.c
src/ccpad.c
src/ccpbkdf2.c
src/ccrc4.c
src/ccansikdf.c
src/ccecies.c
src/ccrng_pbkdf2.c
src/ccec_projective_point.c
src/ccec_points.c
src/ccn_extra.c
src/cczp_extra.c
src/ccgcm.c
src/cch2c.c
src/ccsrp.c
src/ccwrap_priv.c
src/cc_priv.c
src/ccec25519.c
src/cccbc.c
src/ccccm.c
src/cccfb.c
src/cccfb8.c
src/ccchacha20poly1305.c
src/ccctr.c
src/ccofb.c
src/ccxts.c
src/ccckg.c
)
if (DARLING)
add_compile_options(
-nostdinc
)
set(DYLIB_INSTALL_NAME "/usr/lib/system/libcorecrypto.dylib")
add_circular(corecrypto FAT
SOURCES
${corecrypto_sources}
SIBLINGS
system_dyld
compiler_rt
system_kernel
platform
system_malloc
system_c
system_blocks
system_pthread
macho
libdispatch_shared
)
target_link_options(corecrypto PRIVATE
-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/scripts/exported-symbols.exp
)
add_darling_static_library(corecrypto_static FAT SOURCES $<TARGET_OBJECTS:corecrypto_obj>)
install(TARGETS corecrypto DESTINATION libexec/darling/usr/lib/system)
else()
add_library(corecrypto SHARED ${corecrypto_sources})
# TODO: define list of exported symbols for non-Apple linkers
# maybe we should just define CC_EXPORT and sprinkle that throughout our codebase
#
# building for non-Apple platforms is only used for quick testing at the moment,
# so it doesn't matter that much if we have some unwanted exported symbols
endif()
if (ENABLE_TESTS)
add_subdirectory(tests)
endif (ENABLE_TESTS)