forked from zephyrproject-rtos/mbedtls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
119 lines (110 loc) · 4.39 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
116
117
118
119
if(CONFIG_MBEDTLS)
zephyr_interface_library_named(mbedTLS)
if(CONFIG_MBEDTLS_BUILTIN)
target_compile_definitions(mbedTLS INTERFACE
MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CFG_FILE}"
)
target_include_directories(mbedTLS INTERFACE
include
configs
)
zephyr_library()
zephyr_library_sources(zephyr_init.c)
zephyr_library_sources(library/aes.c)
zephyr_library_sources(library/aesni.c)
zephyr_library_sources(library/arc4.c)
zephyr_library_sources(library/aria.c)
zephyr_library_sources(library/asn1parse.c)
zephyr_library_sources(library/asn1write.c)
zephyr_library_sources(library/base64.c)
zephyr_library_sources(library/bignum.c)
zephyr_library_sources(library/blowfish.c)
zephyr_library_sources(library/camellia.c)
zephyr_library_sources(library/ccm.c)
zephyr_library_sources(library/certs.c)
zephyr_library_sources(library/chacha20.c)
zephyr_library_sources(library/chachapoly.c)
zephyr_library_sources(library/cipher.c)
zephyr_library_sources(library/cipher_wrap.c)
zephyr_library_sources(library/cmac.c)
zephyr_library_sources(library/ctr_drbg.c)
zephyr_library_sources(library/debug.c)
zephyr_library_sources(library/des.c)
zephyr_library_sources(library/dhm.c)
zephyr_library_sources(library/ecdh.c)
zephyr_library_sources(library/ecdsa.c)
zephyr_library_sources(library/ecjpake.c)
zephyr_library_sources(library/ecp.c)
zephyr_library_sources(library/ecp_curves.c)
zephyr_library_sources(library/entropy.c)
zephyr_library_sources(library/entropy_poll.c)
zephyr_library_sources(library/error.c)
zephyr_library_sources(library/gcm.c)
zephyr_library_sources(library/havege.c)
zephyr_library_sources(library/hkdf.c)
zephyr_library_sources(library/hmac_drbg.c)
zephyr_library_sources(library/md.c)
zephyr_library_sources(library/md2.c)
zephyr_library_sources(library/md4.c)
zephyr_library_sources(library/md5.c)
zephyr_library_sources(library/md_wrap.c)
zephyr_library_sources(library/memory_buffer_alloc.c)
zephyr_library_sources(library/net_sockets.c)
zephyr_library_sources(library/nist_kw.c)
zephyr_library_sources(library/oid.c)
zephyr_library_sources(library/padlock.c)
zephyr_library_sources(library/pem.c)
zephyr_library_sources(library/pk.c)
zephyr_library_sources(library/pk_wrap.c)
zephyr_library_sources(library/pkcs11.c)
zephyr_library_sources(library/pkcs12.c)
zephyr_library_sources(library/pkcs5.c)
zephyr_library_sources(library/pkparse.c)
zephyr_library_sources(library/pkwrite.c)
zephyr_library_sources(library/platform.c)
zephyr_library_sources(library/platform_util.c)
zephyr_library_sources(library/poly1305.c)
zephyr_library_sources(library/ripemd160.c)
zephyr_library_sources(library/rsa.c)
zephyr_library_sources(library/rsa_internal.c)
zephyr_library_sources(library/sha1.c)
zephyr_library_sources(library/sha256.c)
zephyr_library_sources(library/sha512.c)
zephyr_library_sources(library/ssl_cache.c)
zephyr_library_sources(library/ssl_ciphersuites.c)
zephyr_library_sources(library/ssl_cli.c)
zephyr_library_sources(library/ssl_cookie.c)
zephyr_library_sources(library/ssl_srv.c)
zephyr_library_sources(library/ssl_ticket.c)
zephyr_library_sources(library/ssl_tls.c)
zephyr_library_sources(library/threading.c)
zephyr_library_sources(library/timing.c)
zephyr_library_sources(library/version.c)
zephyr_library_sources(library/version_features.c)
zephyr_library_sources(library/x509.c)
zephyr_library_sources(library/x509_create.c)
zephyr_library_sources(library/x509_crl.c)
zephyr_library_sources(library/x509_crt.c)
zephyr_library_sources(library/x509_csr.c)
zephyr_library_sources(library/x509write_crt.c)
zephyr_library_sources(library/x509write_csr.c)
zephyr_library_sources(library/xtea.c)
zephyr_library_link_libraries(mbedTLS)
else()
assert(CONFIG_MBEDTLS_LIBRARY "MBEDTLS was enabled, but neither BUILTIN or LIBRARY was selected.")
# NB: CONFIG_MBEDTLS_LIBRARY is not regression tested and is
# therefore susceptible to bit rot
target_include_directories(mbedTLS INTERFACE
${CONFIG_MBEDTLS_INSTALL_PATH}
)
zephyr_link_libraries(
mbedtls_external
-L${CONFIG_MBEDTLS_INSTALL_PATH}
gcc
)
# Lib mbedtls_external depends on libgcc (I assume?) so to allow
# mbedtls_external to link with gcc we need to ensure it is placed
# after mbedtls_external on the linkers command line.
endif()
target_link_libraries(mbedTLS INTERFACE zephyr_interface)
endif()