aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-11-26 09:05:18 +0100
committerRobert Tari <robert@tari.in>2021-12-03 12:26:17 +0100
commit5544dd0e3ad817cbe8f433068ee4da32319b10cb (patch)
tree47a9535ec4896aae843035f2d7cd1d9fcdfc8b76 /src
parent87bbf6da491fbbaa5b0d4babe3d3ceb270820695 (diff)
downloadayatana-indicator-datetime-5544dd0e3ad817cbe8f433068ee4da32319b10cb.tar.gz
ayatana-indicator-datetime-5544dd0e3ad817cbe8f433068ee4da32319b10cb.tar.bz2
ayatana-indicator-datetime-5544dd0e3ad817cbe8f433068ee4da32319b10cb.zip
Make Lomiri features configurable at build time
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/main.cpp6
-rw-r--r--src/notifications.cpp6
-rw-r--r--src/snap.cpp2
4 files changed, 11 insertions, 9 deletions
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 <datetime/planner-snooze.h>
#include <datetime/planner-range.h>
#include <datetime/settings-live.h>
-#ifdef HAS_LOMIRI_SCHEMAS
+#ifdef LOMIRI_FEATURES_ENABLED
#include <datetime/snap.h>
#endif
#include <datetime/state.h>
@@ -95,7 +95,7 @@ namespace
return state;
}
-#ifdef HAS_LOMIRI_SCHEMAS
+#ifdef LOMIRI_FEATURES_ENABLED
std::shared_ptr<AlarmQueue> create_simple_alarm_queue(const std::shared_ptr<Clock>& clock,
const std::shared_ptr<Planner>& snooze_planner,
const std::shared_ptr<Engine>& engine,
@@ -149,7 +149,7 @@ main(int /*argc*/, char** /*argv*/)
auto actions = std::make_shared<LiveActions>(state);
MenuFactory factory(actions, state);
-#ifdef HAS_LOMIRI_SCHEMAS
+#ifdef LOMIRI_FEATURES_ENABLED
// set up the snap decisions
auto snooze_planner = std::make_shared<SnoozePlanner>(state->settings, state->clock);
auto notification_engine = std::make_shared<ain::Engine>("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 <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include <notifications/notifications.h>
@@ -24,7 +26,7 @@
#include <messaging-menu/messaging-menu-app.h>
#include <messaging-menu/messaging-menu-message.h>
-#ifdef HAS_URLDISPATCHER
+#ifdef LOMIRI_FEATURES_ENABLED
#include <lomiri-url-dispatcher.h>
#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<const gchar**>(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 <robert@tari.in>
*/
-#ifdef HAS_LOMIRI_SCHEMAS
+#ifdef LOMIRI_FEATURES_ENABLED
#include "dbus-accounts-sound.h"
#include <datetime/snap.h>