[tasque] [build] Fix build on platforms without appindicator



commit 9e76f6f1996aff17340edc94b1afe817d2ae194f
Author: Antonius Riha <antoniusriha gmail com>
Date:   Tue Aug 28 19:05:39 2012 +0200

    [build] Fix build on platforms without appindicator
    
    AppIndicatorTray.cs is only built, if appindicator is enabled (and
    supported). Therefore wrap its initialization in #if APPINDICATOR
    ... #endif and define the compiler flag APPINDICATOR.

 src/GtkTray.cs  |    8 ++------
 src/Makefile.am |    5 +++--
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/GtkTray.cs b/src/GtkTray.cs
index 094cb03..20d4ea4 100644
--- a/src/GtkTray.cs
+++ b/src/GtkTray.cs
@@ -39,17 +39,13 @@ namespace Tasque
 			GtkTray tray;
 			switch (desktopSession) {
 			case "ubuntu":
-				tray = new AppIndicatorTray ();
-				break;
 			case "ubuntu-2d":
-				tray = new AppIndicatorTray ();
-				break;
 			case "gnome-classic":
-				tray = new AppIndicatorTray ();
-				break;
 			case "gnome-fallback":
+#if APPINDICATOR
 				tray = new AppIndicatorTray ();
 				break;
+#endif
 			default:
 				tray = new StatusIconTray ();
 				break;
diff --git a/src/Makefile.am b/src/Makefile.am
index f9965f4..a575a33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -58,6 +58,7 @@ endif
 
 if ENABLE_APPINDICATOR
 APPINDICATOR_CSFILES = $(srcdir)/AppIndicatorTray.cs
+APPINDICATOR_CSFLAGS = -define:APPINDICATOR
 else
 APPINDICATOR_CSFILES =
 endif
@@ -172,8 +173,8 @@ ASSEMBLIES =  \
 	$(APPINDICATOR_SHARP_LIBS)
 
 $(TARGET): $(CSFILES) Defines.cs
-	$(CSC) -unsafe -out:$@ -noconfig -codepage:utf8 -warn:4 $(CSFLAGS) \
-	$(GTK_2_12_CSFLAGS) $(NOTIFY_SHARP_CSFLAGS) $^ $(ASSEMBLIES) $(RESOURCES)
+	$(CSC) -unsafe -out:$@ -noconfig -codepage:utf8 -warn:4 $(CSFLAGS) $(GTK_2_12_CSFLAGS) \
+	$(NOTIFY_SHARP_CSFLAGS) $(APPINDICATOR_CSFLAGS) $^ $(ASSEMBLIES) $(RESOURCES)
 
 tasquelibdir = $(libdir)/tasque
 tasquelib_DATA = $(TARGET) $(TARGET).config $(MDBFILES)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]