123456789101112131415161718192021222324252627282930313233343536 |
- cmake_minimum_required(VERSION 3.8)
- cmake_policy(SET CMP0069 NEW)
- include(CheckIPOSupported)
- check_ipo_supported(RESULT supported OUTPUT error)
- if( supported )
- message(STATUS "IPO / LTO enabled")
- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
- else()
- message(STATUS "IPO / LTO not supported: <${error}>")
- endif()
- if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AVR" ))
- message(FATAL_ERROR "wrong system processor ${CMAKE_SYSTEM_PROCESSOR}, expected: AVR")
- endif()
- message(STATUS "will use stdlib++ from '${LIBSTDCPP_HOME}'")
- add_library(board board.cpp)
- target_include_directories(rotor_light PUBLIC "${LIBSTDCPP_HOME}/include")
- target_include_directories(board PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
- target_link_libraries(board rotor_light)
- add_executable(blink-led blink-led.cpp)
- target_link_libraries(blink-led board)
- add_executable(blink-led-uart blink-led-uart.cpp)
- target_link_libraries(blink-led-uart board)
- add_executable(ping-pong-poll ping-pong-poll.cpp)
- target_link_libraries(ping-pong-poll board)
- add_executable(ping-pong-await ping-pong-await.cpp)
- target_link_libraries(ping-pong-await board)
|