CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # CMakeList.txt
  2. #
  3. # Copyright (C) 2006-2022 wolfSSL Inc.
  4. #
  5. # This file is part of wolfSSL. (formerly known as CyaSSL)
  6. #
  7. # Usage:
  8. # In MSVS 2019 with Azure Sphere plugin installed choose option
  9. # "Open Local Folder" and browse to wolfssl-root/IDE/MSVS-2019-AZSPHERE"
  10. # highlight wolfssl_new_azsphere and select "Open"
  11. #
  12. # To build:
  13. # go to MSVS menu option "Build" and select "Build All"
  14. #
  15. # See https://docs.microsoft.com/en-us/azure-sphere/install/overview for how
  16. # to get started with an Azure sphere device. Once you have completed the step
  17. # to build/flash and run the Blinky example you will be ready to build/flash
  18. # and run this example!
  19. cmake_minimum_required (VERSION 3.4.1)
  20. project (wolfssl_new_azsphere C)
  21. azsphere_configure_tools(TOOLS_REVISION "22.02")
  22. azsphere_configure_api(TARGET_API_SET "12")
  23. # add wolfSSL preprocessor directives
  24. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS -Wno-conversion -Wno-sign-conversion")
  25. # add a shared object for SSL/TLS and CRYPTO
  26. set( SSL_SRC_DIR "../../../src" )
  27. set( CRYPTO_SRC_DIR "../../../wolfcrypt/src" )
  28. set( INCLUDE_DIR "../../.." )
  29. aux_source_directory( ${SSL_SRC_DIR} SSL_SOURCES )
  30. list( REMOVE_ITEM SSL_SOURCES ../../../src/bio.c )
  31. list( REMOVE_ITEM SSL_SOURCES ../../../src/conf.c )
  32. list( REMOVE_ITEM SSL_SOURCES ../../../src/x509.c )
  33. list( REMOVE_ITEM SSL_SOURCES ../../../src/x509_str.c )
  34. list( REMOVE_ITEM SSL_SOURCES ../../../src/pk.c )
  35. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_asn1.c )
  36. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_bn.c )
  37. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_certman.c )
  38. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_crypto.c )
  39. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_load.c )
  40. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_misc.c )
  41. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_p7p12.c )
  42. list( REMOVE_ITEM SSL_SOURCES ../../../src/ssl_sess.c )
  43. aux_source_directory( ${CRYPTO_SRC_DIR} CRYPTO_SOURCES )
  44. list( REMOVE_ITEM CRYPTO_SOURCES ../../../wolfcrypt/src/evp.c )
  45. list( REMOVE_ITEM CRYPTO_SOURCES ../../../wolfcrypt/src/misc.c )
  46. add_library( wolfssl STATIC ${SSL_SOURCES} ${CRYPTO_SOURCES} )
  47. # Create executable that uses library
  48. set( SERVER_APP_DIR "../server" )
  49. set( CLIENT_APP_DIR "../client" )
  50. set( USER_SETTINGS_DIR ".." )
  51. set( APP_INCLUDE_DIRS ${SERVER_APP_DIR} ${CLIENT_APP_DIR} ${USER_SETTINGS_DIR} )
  52. add_executable (${PROJECT_NAME} main.c ${SERVER_APP_DIR}/server.c ${CLIENT_APP_DIR}/client.c )
  53. target_link_libraries (${PROJECT_NAME} applibs pthread gcc_s c wolfssl)
  54. include_directories( ${INCLUDE_DIR} ${APP_INCLUDE_DIRS})
  55. # azsphere_target_hardware_definition(${PROJECT_NAME} TARGET_DIRECTORY "HardwareDefinitions/mt3620_rdb" TARGET_DEFINITION "template_appliance.json")
  56. azsphere_target_hardware_definition(${PROJECT_NAME} TARGET_DIRECTORY "HardwareDefinitions/seeed_mt3620_mdb" TARGET_DEFINITION "template_appliance.json")
  57. azsphere_target_add_image_package(${PROJECT_NAME})