build-sys: try to get along without a C++ compiler if Qt is not enabled.
authorKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 27 May 2014 08:10:33 +0000 (11:10 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Tue, 27 May 2014 09:56:03 +0000 (12:56 +0300)
src/Makefile.am
src/common/tests/Makefile.am
src/common/tests/mainloop-qt-test.cpp
src/common/tests/mainloop-test.c

index f464314..13d37f0 100644 (file)
@@ -787,7 +787,7 @@ libmurphy_qt_la_LDFLAGS =           \
 
 libmurphy_qt_la_LIBADD  = $(QTCORE_LIBS)
 
-libmurphy_qt_la_DEPENDENCIES =
+libmurphy_qt_la_DEPENDENCIES =         \
                linker-script.qt        \
                $(filter %.la, $(libmurphy_qt_la_LIBADD))
 
index f6ef476..fa4ae5c 100644 (file)
@@ -36,15 +36,13 @@ mainloop_test_CFLAGS += $(GLIB_CFLAGS)
 mainloop_test_LDADD  += ../../libmurphy-glib.la $(GLIB_LIBS)
 endif
 
+if QT_ENABLED
 noinst_LTLIBRARIES = libmainloop-qt-test.la
 libmainloop_qt_test_la_SOURCES  = mainloop-qt-test.cpp
 libmainloop_qt_test_la_CPPFLAGS = $(AM_CFLAGS) $(QTCORE_CFLAGS)
-libmainloop_qt_test_la_LIBADD   = ../../libmurphy-common.la
-mainloop_test_LDADD            += libmainloop-qt-test.la
-
-if QT_ENABLED
-libmainloop_qt_test_la_LIBADD  += ../../libmurphy-qt.la $(QTCORE_LIBS)
-mainloop_test_LDADD            += ../../libmurphy-qt.la $(QTCORE_LIBS)
+libmainloop_qt_test_la_LIBADD   = ../../libmurphy-common.la \
+                                 ../../libmurphy-qt.la $(QTCORE_LIBS)
+mainloop_test_LDADD            += libmainloop-qt-test.la $(QTCORE_LIBS) -lstdc++
 endif
 
 # msg test
index c192daa..4c047a6 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "mainloop-qt-test.h"
 
-#ifdef QT_ENABLED
 #include <QCoreApplication>
 #include <murphy/common/qt-glue.h>
 
@@ -108,33 +107,3 @@ int qt_mainloop_cleanup(mrp_mainloop_t *ml)
     else
         return FALSE;
 }
-
-#else // QT_ENABLED
-
-mrp_mainloop_t *qt_mainloop_create()
-{
-    mrp_log_error("Qt mainloop support is not available.");
-    exit(1);
-}
-
-int qt_mainloop_run()
-{
-    mrp_log_error("Qt mainloop support is not available.");
-    exit(1);
-}
-
-int qt_mainloop_quit()
-{
-    mrp_log_error("Qt mainloop support is not available.");
-    exit(1);
-}
-
-int qt_mainloop_cleanup(mrp_mainloop_t *ml)
-{
-    MRP_UNUSED(ml);
-
-    mrp_log_error("Qt mainloop support is not available.");
-    exit(1);
-}
-
-#endif // QT_ENABLED
index 52d7f3c..658cf47 100644 (file)
@@ -1608,9 +1608,11 @@ static mrp_mainloop_t *mainloop_create(test_config_t *cfg)
         glib_mainloop_create(cfg);
         break;
 
+#ifdef QT_ENABLED
     case MAINLOOP_QT:
         cfg->ml = qt_mainloop_create();
         break;
+#endif
 
     default:
         mrp_log_error("Invalid mainloop type 0x%x.", cfg->mainloop_type);
@@ -1645,9 +1647,11 @@ static void mainloop_run(test_config_t *cfg)
         glib_mainloop_run(cfg);
         break;
 
+#ifdef QT_ENABLED
     case MAINLOOP_QT:
         qt_mainloop_run();
         break;
+#endif
 
     default:
         mrp_log_error("Invalid mainloop type 0x%x.", cfg->mainloop_type);
@@ -1675,9 +1679,11 @@ static void mainloop_quit(test_config_t *cfg)
         glib_mainloop_quit(cfg);
         break;
 
+#ifdef QT_ENABLED
     case MAINLOOP_QT:
         qt_mainloop_quit();
         break;
+#endif
 
     default:
         mrp_log_error("Invalid mainloop type 0x%x.", cfg->mainloop_type);
@@ -1704,10 +1710,12 @@ void mainloop_cleanup(test_config_t *cfg)
         glib_mainloop_cleanup(cfg);
         break;
 
+#ifdef QT_ENABLED
     case MAINLOOP_QT:
         qt_mainloop_cleanup(cfg->ml);
         cfg->ml = NULL;
         break;
+#endif
 
     default:
         mrp_log_error("Unknown mainloop type (0x%x).", cfg->mainloop_type);