CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. find_package(Chibios REQUIRED)
  2. target_link_options(qmk PUBLIC
  3. -mcpu=${MCU}
  4. -mthumb
  5. -mno-thumb-interwork
  6. -mno-unaligned-access
  7. )
  8. target_compile_definitions(qmk PUBLIC
  9. MCU_${MCU_FAMILY}
  10. THUMB_PRESENT
  11. THUMB_NO_INTERWORKING
  12. PLATFORM_SUPPORTS_SYNCHRONIZATION
  13. PORT_IGNORE_GCC_VERSION_CHECK=1
  14. )
  15. if(NOT ${USE_FPU})
  16. target_compile_options(qmk PUBLIC
  17. -mfloat-abi=hard
  18. -mfpu=fpv4-sp-d16
  19. -fsingle-precision-constant
  20. )
  21. target_compile_definitions(qmk PUBLIC
  22. CORTEX_USE_FPU=TRUE
  23. )
  24. else()
  25. target_compile_definitions(qmk PUBLIC
  26. CORTEX_USE_FPU=FALSE
  27. )
  28. endif()
  29. # bootloader
  30. if(${BOOTLOADER} STREQUAL "stm32-dfu")
  31. target_compile_definitions(qmk PUBLIC BOOTLOADER_STM32_DFU)
  32. set(BOOTLOADER_TYPE stm32_dfu)
  33. endif()
  34. target_sources(qmk PUBLIC
  35. syscall-fallbacks.c
  36. wait.c
  37. synchronization_util.c
  38. hardware_id.c
  39. platform.c
  40. suspend.c
  41. timer.c
  42. bootloaders/${BOOTLOADER_TYPE}.c
  43. )
  44. target_include_directories(qmk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
  45. target_include_directories(qmk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boards/common/configs)
  46. target_include_directories(qmk PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}/configs)
  47. # mabye this should be in a different place
  48. add_subdirectory(${CMAKE_SOURCE_DIR}/quantum/logging logging)