1 2include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs 3 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/zlib) 4 5spec2def(mbedtls.dll mbedtls.spec ADD_IMPORTLIB) 6 7list(APPEND SOURCE 8 _reactos_strsafe_wrapper.c 9 aes.c 10 aesni.c 11 arc4.c 12 #aria.c 13 asn1parse.c 14 asn1write.c 15 #base64.c 16 bignum.c 17 blowfish.c 18 camellia.c 19 ccm.c 20 #certs.c 21 #chacha20.c 22 #chachapoly.c 23 cipher.c 24 cipher_wrap.c 25 #cmac.c 26 ctr_drbg.c 27 #debug.c 28 des.c 29 dhm.c 30 ecdh.c 31 ecdsa.c 32 ecp.c 33 ecp_curves.c 34 entropy.c 35 entropy_poll.c 36 #error.c 37 gcm.c 38 #havege.c 39 #hkdf.c 40 hmac_drbg.c 41 #md2.c 42 #md4.c 43 md5.c 44 md.c 45 md_wrap.c 46 #memory_buffer_alloc.c 47 #net_sockets.c 48 #nist_kw.c 49 oid.c 50 padlock.c 51 #pem.c 52 pk.c 53 #pkcs11.c 54 pkcs12.c 55 pkcs5.c 56 pkparse.c 57 pk_wrap.c 58 #pkwrite.c 59 platform.c 60 platform_util.c 61 #poly1305.c 62 ripemd160.c 63 rsa.c 64 rsa_internal.c 65 sha1.c 66 sha256.c 67 sha512.c 68 #ssl_cache.c 69 ssl_ciphersuites.c 70 ssl_cli.c 71 #ssl_cookie.c 72 #ssl_srv.c 73 #ssl_ticket.c 74 ssl_tls.c 75 #threading.c 76 timing.c 77 #version.c 78 #version_features.c 79 x509.c 80 #x509_create.c 81 #x509_crl.c 82 x509_crt.c 83 #x509_csr.c 84 #x509write_crt.c 85 #x509write_csr.c 86 #xtea.c 87 ) 88 89add_library(mbedtls MODULE 90 ${SOURCE} 91 mbedtls.rc 92 ${CMAKE_CURRENT_BINARY_DIR}/mbedtls.def) 93 94set_module_type(mbedtls win32dll) 95add_importlibs(mbedtls advapi32 msvcrt kernel32 ntdll) 96 97# to use `_vsnprintf_s` looks like we have to define MINGW_HAS_SECURE_API 98# and explicitly export it from msvcrt for it to work... what on earth?! 99add_definitions(-DMINGW_HAS_SECURE_API -DCRTDLL) 100 101add_cd_file(TARGET mbedtls DESTINATION reactos/system32 FOR all) 102 103if(NOT MSVC) 104 target_compile_options(mbedtls PRIVATE -Wno-pointer-sign -Wno-unused-function) 105endif() 106 107if(CMAKE_C_COMPILER_ID STREQUAL "Clang") 108 target_compile_options(mbedtls PRIVATE -Wno-tautological-constant-compare) 109endif() 110