CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. cmake_minimum_required(VERSION 3.8)
  2. cmake_policy(SET CMP0069 NEW)
  3. if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AVR")
  4. add_subdirectory("atmega328p")
  5. elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Cortex-M7")
  6. add_subdirectory("NUCLEO-H743ZI2")
  7. elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "MICROBLAZE")
  8. add_subdirectory("mb")
  9. elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Cortex-M4")
  10. add_subdirectory("stm32f407g-disc1")
  11. elseif ("${TOOLCHAIN_PREFIX}" STREQUAL "")
  12. add_subdirectory("host")
  13. set(CMAKE_SIZE_UTIL size CACHE INTERNAL "size tool")
  14. endif()
  15. # any platform, as there is no timer
  16. add_executable(ping-pong-throughput ping-pong-throughput.cpp)
  17. target_link_libraries(ping-pong-throughput board)
  18. add_custom_command(TARGET ping-pong-throughput
  19. POST_BUILD COMMAND ${CMAKE_SIZE_UTIL} ping-pong-throughput)
  20. #if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Cortex-M7")
  21. # set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/NUCLEO-H743ZI2/STM32H743ZITx_FLASH.ld)
  22. # target_link_options(ping-pong-throughput PUBLIC -T ${LINKER_SCRIPT})
  23. #endif()
  24. if (DEFINED LINKER_SCRIPT)
  25. target_link_options(ping-pong-throughput PUBLIC -T ${LINKER_SCRIPT})
  26. endif()