From 21f3bd708261ece47096961039e65d5b6f113c73 Mon Sep 17 00:00:00 2001 From: tnixeu <4436784+tnixeu@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:46:31 +0200 Subject: [PATCH] prepare cmake unity build Exclude files from unity build which currently cause compile erros because of redefinitions. --- src/CMakeLists.txt | 23 +++++++++++++++++++++++ src/displayapp/fonts/CMakeLists.txt | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 64b7ffbd..dca78f3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1157,3 +1157,26 @@ if(BUILD_RESOURCES) add_subdirectory(resources) endif() +# skip files, which currently cause problems when turning on CMake untiy build +set_source_files_properties( + "${NRF5_SDK_PATH}/integration/nrfx/legacy/nrf_drv_clock.c" + "${NRF5_SDK_PATH}/modules/nrfx/drivers/src/nrfx_saadc.c" + ${CMAKE_CURRENT_SOURCE_DIR}/components/ble/AlertNotificationClient.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/components/ble/NavigationService.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/components/ble/NavigationService.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingChimes.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingDisplay.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingSetDate.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingSetTime.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingShakeThreshold.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingSteps.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/settings/SettingWakeUp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/WatchFaceInfineat.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/displayapp/screens/WatchFacePineTimeStyle.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/libs/lvgl/src/lv_core/lv_obj.c + ${CMAKE_CURRENT_SOURCE_DIR}/libs/mynewt-nimble/ext/tinycrypt/src/ecc_dh.c + PROPERTIES + SKIP_UNITY_BUILD_INCLUSION + ON + ) + diff --git a/src/displayapp/fonts/CMakeLists.txt b/src/displayapp/fonts/CMakeLists.txt index 84830cc0..45687dc1 100644 --- a/src/displayapp/fonts/CMakeLists.txt +++ b/src/displayapp/fonts/CMakeLists.txt @@ -32,6 +32,12 @@ foreach(FONT ${FONTS}) add_custom_target(infinitime_fonts_${FONT} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FONT}.c ) + +# skip files, which currently cause problems when turning on CMake untiy build + set_source_files_properties( + ${FONT}.c PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON + ) + target_sources(infinitime_fonts PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${FONT}.c") add_dependencies(infinitime_fonts infinitime_fonts_${FONT}) endforeach()