Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 lines
4.1 KiB

  1. ##
  2. ## ______ _
  3. ## / _____) _ | |
  4. ## ( (____ _____ ____ _| |_ _____ ____| |__
  5. ## \____ \| ___ | (_ _) ___ |/ ___) _ \
  6. ## _____) ) ____| | | || |_| ____( (___| | | |
  7. ## (______/|_____)_|_|_| \__)_____)\____)_| |_|
  8. ## (C)2013-2017 Semtech
  9. ## ___ _____ _ ___ _ _____ ___ ___ ___ ___
  10. ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
  11. ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
  12. ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
  13. ## embedded.connectivity.solutions.==============
  14. ##
  15. ## License: Revised BSD License, see LICENSE.TXT file included in the project
  16. ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech )
  17. ##
  18. ##
  19. ## CMake arm-none-eabi toolchain file
  20. ##
  21. # Append current directory to CMAKE_MODULE_PATH for making device specific cmake modules visible
  22. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
  23. # Target definition
  24. set(CMAKE_SYSTEM_NAME Generic)
  25. set(CMAKE_SYSTEM_PROCESSOR ARM)
  26. #---------------------------------------------------------------------------------------
  27. # Set toolchain paths
  28. #---------------------------------------------------------------------------------------
  29. set(TOOLCHAIN arm-none-eabi)
  30. if(NOT DEFINED TOOLCHAIN_PREFIX)
  31. if(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux)
  32. set(TOOLCHAIN_PREFIX "/usr")
  33. elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
  34. set(TOOLCHAIN_PREFIX "/usr/local")
  35. elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
  36. message(STATUS "Please specify the TOOLCHAIN_PREFIX !\n For example: -DTOOLCHAIN_PREFIX=\"C:/Program Files/GNU Tools ARM Embedded\" ")
  37. else()
  38. set(TOOLCHAIN_PREFIX "/usr")
  39. message(STATUS "No TOOLCHAIN_PREFIX specified, using default: " ${TOOLCHAIN_PREFIX})
  40. endif()
  41. endif()
  42. set(TOOLCHAIN_BIN_DIR ${TOOLCHAIN_PREFIX}/bin)
  43. set(TOOLCHAIN_INC_DIR ${TOOLCHAIN_PREFIX}/${TOOLCHAIN}/include)
  44. set(TOOLCHAIN_LIB_DIR ${TOOLCHAIN_PREFIX}/${TOOLCHAIN}/lib)
  45. # Set system depended extensions
  46. if(WIN32)
  47. set(TOOLCHAIN_EXT ".exe" )
  48. else()
  49. set(TOOLCHAIN_EXT "" )
  50. endif()
  51. # Perform compiler test with static library
  52. set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
  53. #---------------------------------------------------------------------------------------
  54. # Preset some general GCC Options
  55. #---------------------------------------------------------------------------------------
  56. # Options for DEBUG build
  57. # -Og enables optimizations that do not interfere with debugging
  58. # -g produce debugging information in the operating system’s native format
  59. set(CMAKE_C_FLAGS_DEBUG "-Og -g -DDEBUG" CACHE INTERNAL "C Compiler options for debug build type")
  60. set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DDEBUG" CACHE INTERNAL "C++ Compiler options for debug build type")
  61. set(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "ASM Compiler options for debug build type")
  62. set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "Linker options for debug build type")
  63. # Options for RELEASE build
  64. # -Os Optimize for size. -Os enables all -O2 optimizations
  65. set(CMAKE_C_FLAGS_RELEASE "-Os" CACHE INTERNAL "C Compiler options for release build type")
  66. set(CMAKE_CXX_FLAGS_RELEASE "-Os" CACHE INTERNAL "C++ Compiler options for release build type")
  67. set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "ASM Compiler options for release build type")
  68. set(CMAKE_EXE_LINKER_FLAGS_RELEASE "" CACHE INTERNAL "Linker options for release build type")
  69. #---------------------------------------------------------------------------------------
  70. # Set compilers
  71. #---------------------------------------------------------------------------------------
  72. set(CMAKE_C_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-gcc${TOOLCHAIN_EXT} CACHE INTERNAL "C Compiler")
  73. set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-g++${TOOLCHAIN_EXT} CACHE INTERNAL "C++ Compiler")
  74. set(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-gcc${TOOLCHAIN_EXT} CACHE INTERNAL "ASM Compiler")
  75. set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/${${TOOLCHAIN}} ${CMAKE_PREFIX_PATH})
  76. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  77. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  78. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  79. set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)