CMakeLists.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. zephyr_interface_library_named(wolfSSL)
  2. if(CONFIG_WOLFSSL_BUILTIN)
  3. target_compile_definitions(wolfSSL INTERFACE
  4. WOLFSSL_OPTIONS_FILE="${CONFIG_WOLFSSL_OPTIONS_FILE}"
  5. )
  6. target_include_directories(wolfSSL INTERFACE
  7. include
  8. settings
  9. )
  10. zephyr_library()
  11. zephyr_library_sources(zephyr_init.c)
  12. zephyr_library_sources(library/src/crl.c)
  13. zephyr_library_sources(library/src/internal.c)
  14. zephyr_library_sources(library/src/keys.c)
  15. zephyr_library_sources(library/src/ocsp.c)
  16. zephyr_library_sources(library/src/sniffer.c)
  17. zephyr_library_sources(library/src/ssl.c)
  18. zephyr_library_sources(library/src/tls13.c)
  19. zephyr_library_sources(library/src/tls.c)
  20. zephyr_library_sources(library/src/wolfio.c)
  21. zephyr_library_sources(library/wolfcrypt/src/aes.c)
  22. zephyr_library_sources(library/wolfcrypt/src/arc4.c)
  23. zephyr_library_sources(library/wolfcrypt/src/asm.c)
  24. zephyr_library_sources(library/wolfcrypt/src/asn.c)
  25. zephyr_library_sources(library/wolfcrypt/src/async.c)
  26. zephyr_library_sources(library/wolfcrypt/src/blake2b.c)
  27. zephyr_library_sources(library/wolfcrypt/src/camellia.c)
  28. zephyr_library_sources(library/wolfcrypt/src/chacha20_poly1305.c)
  29. zephyr_library_sources(library/wolfcrypt/src/chacha.c)
  30. zephyr_library_sources(library/wolfcrypt/src/cmac.c)
  31. zephyr_library_sources(library/wolfcrypt/src/coding.c)
  32. zephyr_library_sources(library/wolfcrypt/src/compress.c)
  33. zephyr_library_sources(library/wolfcrypt/src/cpuid.c)
  34. zephyr_library_sources(library/wolfcrypt/src/cryptocb.c)
  35. zephyr_library_sources(library/wolfcrypt/src/curve25519.c)
  36. zephyr_library_sources(library/wolfcrypt/src/des3.c)
  37. zephyr_library_sources(library/wolfcrypt/src/dh.c)
  38. zephyr_library_sources(library/wolfcrypt/src/dsa.c)
  39. zephyr_library_sources(library/wolfcrypt/src/ecc.c)
  40. zephyr_library_sources(library/wolfcrypt/src/ecc_fp.c)
  41. zephyr_library_sources(library/wolfcrypt/src/ed25519.c)
  42. zephyr_library_sources(library/wolfcrypt/src/error.c)
  43. zephyr_library_sources(library/wolfcrypt/src/fe_low_mem.c)
  44. zephyr_library_sources(library/wolfcrypt/src/fe_operations.c)
  45. #zephyr_library_sources(library/wolfcrypt/src/fips.c)
  46. #zephyr_library_sources(library/wolfcrypt/src/fips_test.c)
  47. zephyr_library_sources(library/wolfcrypt/src/ge_low_mem.c)
  48. zephyr_library_sources(library/wolfcrypt/src/ge_operations.c)
  49. zephyr_library_sources(library/wolfcrypt/src/hash.c)
  50. zephyr_library_sources(library/wolfcrypt/src/hc128.c)
  51. zephyr_library_sources(library/wolfcrypt/src/hmac.c)
  52. zephyr_library_sources(library/wolfcrypt/src/idea.c)
  53. zephyr_library_sources(library/wolfcrypt/src/integer.c)
  54. zephyr_library_sources(library/wolfcrypt/src/logging.c)
  55. zephyr_library_sources(library/wolfcrypt/src/md2.c)
  56. zephyr_library_sources(library/wolfcrypt/src/md4.c)
  57. zephyr_library_sources(library/wolfcrypt/src/md5.c)
  58. zephyr_library_sources(library/wolfcrypt/src/memory.c)
  59. #zephyr_library_sources(library/wolfcrypt/src/misc.c)
  60. zephyr_library_sources(library/wolfcrypt/src/pkcs12.c)
  61. zephyr_library_sources(library/wolfcrypt/src/pkcs7.c)
  62. zephyr_library_sources(library/wolfcrypt/src/poly1305.c)
  63. zephyr_library_sources(library/wolfcrypt/src/pwdbased.c)
  64. zephyr_library_sources(library/wolfcrypt/src/rabbit.c)
  65. zephyr_library_sources(library/wolfcrypt/src/random.c)
  66. zephyr_library_sources(library/wolfcrypt/src/ripemd.c)
  67. zephyr_library_sources(library/wolfcrypt/src/rsa.c)
  68. #zephyr_library_sources(library/wolfcrypt/src/selftest.c)
  69. zephyr_library_sources(library/wolfcrypt/src/sha256.c)
  70. zephyr_library_sources(library/wolfcrypt/src/sha3.c)
  71. zephyr_library_sources(library/wolfcrypt/src/sha512.c)
  72. zephyr_library_sources(library/wolfcrypt/src/sha.c)
  73. zephyr_library_sources(library/wolfcrypt/src/signature.c)
  74. zephyr_library_sources(library/wolfcrypt/src/sp_arm32.c)
  75. zephyr_library_sources(library/wolfcrypt/src/sp_arm64.c)
  76. zephyr_library_sources(library/wolfcrypt/src/sp_armthumb.c)
  77. zephyr_library_sources(library/wolfcrypt/src/sp_c32.c)
  78. zephyr_library_sources(library/wolfcrypt/src/sp_c64.c)
  79. zephyr_library_sources(library/wolfcrypt/src/sp_cortexm.c)
  80. zephyr_library_sources(library/wolfcrypt/src/sp_int.c)
  81. zephyr_library_sources(library/wolfcrypt/src/sp_x86_64.c)
  82. zephyr_library_sources(library/wolfcrypt/src/srp.c)
  83. zephyr_library_sources(library/wolfcrypt/src/tfm.c)
  84. zephyr_library_sources(library/wolfcrypt/src/wc_encrypt.c)
  85. zephyr_library_sources(library/wolfcrypt/src/wc_pkcs11.c)
  86. zephyr_library_sources(library/wolfcrypt/src/wc_port.c)
  87. #zephyr_library_sources(library/wolfcrypt/src/wolfcrypt_first.c)
  88. #zephyr_library_sources(library/wolfcrypt/src/wolfcrypt_last.c)
  89. zephyr_library_sources(library/wolfcrypt/src/wolfevent.c)
  90. zephyr_library_sources(library/wolfcrypt/src/wolfmath.c)
  91. zephyr_library_link_libraries(wolfSSL)
  92. add_definitions(-DWOLFSSL_USER_SETTINGS)
  93. add_definitions(-DWOLFSSL_ZEPHYR)
  94. include_directories("library")
  95. else()
  96. assert(CONFIG_WOLFSSL_LIBRARY "wolfSSL was enabled, but neither BUILTIN or LIBRARY was selected.")
  97. # NB: CONFIG_WOLFSSL_LIBRARY is not regression tested and is
  98. # therefore susceptible to bit rot
  99. target_include_directories(wolfSSL INTERFACE
  100. ${CONFIG_WOLFSSL_INSTALL_PATH}
  101. )
  102. zephyr_link_libraries(
  103. mbedtls_external
  104. -L${CONFIG_WOLFSSL_INSTALL_PATH}
  105. gcc
  106. )
  107. # Lib wolfssl depends on libgcc so to allow
  108. # wolfssl to link with gcc we need to ensure it is placed
  109. # after wolfssl_external on the linkers command line.
  110. endif()
  111. target_link_libraries(wolfSSL INTERFACE zephyr_interface)