From 5544dd0e3ad817cbe8f433068ee4da32319b10cb Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 26 Nov 2021 09:05:18 +0100 Subject: Make Lomiri features configurable at build time --- src/CMakeLists.txt | 6 +++--- src/main.cpp | 6 +++--- src/notifications.cpp | 6 ++++-- src/snap.cpp | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6d6844..5409c91 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,11 +47,11 @@ set(SERVICE_GENERATED_SOURCES) add_gdbus_codegen(SERVICE_GENERATED_SOURCES dbus-alarm-properties org.ayatana.indicator ${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.datetime.AlarmProperties.xml) -if(LOMIRI_SCHEMAS_FOUND) + +if (ENABLE_LOMIRI_FEATURES) add_gdbus_codegen(SERVICE_GENERATED_SOURCES dbus-accounts-sound com.lomiri.touch /usr/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml) - add_definitions (-DHAS_LOMIRI_SCHEMAS) endif() # add warnings/coverage info on handwritten files @@ -70,5 +70,5 @@ link_directories (${SERVICE_DEPS_LIBRARY_DIRS}) add_executable (${SERVICE_EXEC} main.cpp) set_source_files_properties(${SERVICE_SOURCES} main.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) -target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${URLDISPATCHER_LIBRARIES}) +target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES}) install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}) diff --git a/src/main.cpp b/src/main.cpp index 0dc7198..4590e84 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,7 +32,7 @@ #include #include #include -#ifdef HAS_LOMIRI_SCHEMAS +#ifdef LOMIRI_FEATURES_ENABLED #include #endif #include @@ -95,7 +95,7 @@ namespace return state; } -#ifdef HAS_LOMIRI_SCHEMAS +#ifdef LOMIRI_FEATURES_ENABLED std::shared_ptr create_simple_alarm_queue(const std::shared_ptr& clock, const std::shared_ptr& snooze_planner, const std::shared_ptr& engine, @@ -149,7 +149,7 @@ main(int /*argc*/, char** /*argv*/) auto actions = std::make_shared(state); MenuFactory factory(actions, state); -#ifdef HAS_LOMIRI_SCHEMAS +#ifdef LOMIRI_FEATURES_ENABLED // set up the snap decisions auto snooze_planner = std::make_shared(state->settings, state->clock); auto notification_engine = std::make_shared("ayatana-indicator-datetime-service"); diff --git a/src/notifications.cpp b/src/notifications.cpp index f21b5e8..e38e5dc 100644 --- a/src/notifications.cpp +++ b/src/notifications.cpp @@ -1,5 +1,6 @@ /* * Copyright 2014 Canonical Ltd. + * Copyright 2021 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr + * Robert Tari */ #include @@ -24,7 +26,7 @@ #include #include -#ifdef HAS_URLDISPATCHER +#ifdef LOMIRI_FEATURES_ENABLED #include #endif @@ -462,7 +464,7 @@ private: static std::string calendar_app_id() { -#ifdef HAS_URLDISPATCHER +#ifdef LOMIRI_FEATURES_ENABLED auto urls = g_strsplit("calendar://", ",", 0); auto appids = lomiri_url_dispatch_url_appid(const_cast(urls)); g_strfreev(urls); diff --git a/src/snap.cpp b/src/snap.cpp index e306dea..46f1d7b 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -19,7 +19,7 @@ * Robert Tari */ -#ifdef HAS_LOMIRI_SCHEMAS +#ifdef LOMIRI_FEATURES_ENABLED #include "dbus-accounts-sound.h" #include -- cgit v1.2.3