From 22f6d4a40b6715b436f5eb3bf8524fa955eccd20 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 24 Dec 2023 11:44:37 +0100 Subject: Watch face selection using CMake The list of watch face to build into the firmware is now set by CMake (-DENABLE_WATCHFACES). Fix SettingWatchFace : convert to index to/from WatchFace when needed. --- src/displayapp/apps/Apps.h.in | 7 +------ src/displayapp/apps/CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/displayapp/apps') diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in index 11fe17b5..e6e8d7dc 100644 --- a/src/displayapp/apps/Apps.h.in +++ b/src/displayapp/apps/Apps.h.in @@ -71,12 +71,7 @@ namespace Pinetime { static constexpr size_t Count = sizeof...(Ws); }; - using UserWatchFaceTypes = WatchFaceTypeList; + using UserWatchFaceTypes = WatchFaceTypeList<@WATCHFACE_TYPES@>; static_assert(UserWatchFaceTypes::Count >= 1); } diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index 3544443a..4f0e4c49 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -17,6 +17,12 @@ else () set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif () +if(DEFINED ENABLE_WATCHFACES) + set(WATCHFACE_TYPES ${ENABLE_WATCHFACES} CACHE STRING "List of watch faces to build into the firmware") +else() + set(WATCHFACE_TYPES "WatchFace::Digital, WatchFace::Analog, WatchFace::PineTimeStyle, WatchFace::Terminal, WatchFace::Infineat, WatchFace::CasioStyleG7710" CACHE STRING "List of watch faces to build into the firmware") +endif() + add_library(infinitime_apps INTERFACE) target_sources(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/Apps.h") target_include_directories(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/") -- cgit v1.2.3-70-g09d2