Skip to content

Commit 082b543

Browse files
Johnny CarlsonJohnny Carlson
Johnny Carlson
authored and
Johnny Carlson
committed
qmltest: configure to only compile with qml and tests enabled
1 parent 7603dc8 commit 082b543

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

build-aux/m4/bitcoin_qt.m4

+5-2
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
306306
if test "$have_qt_test" = "no"; then
307307
bitcoin_enable_qt_test=no
308308
fi
309+
bitcoin_enable_qml_test=yes
310+
if test "$have_qml_test" = "no"; then
311+
bitcoin_enable_qml_test=no
312+
fi
309313
bitcoin_enable_qt_dbus=no
310314
if test "$use_dbus" != "no" && test "$have_qt_dbus" = "yes"; then
311315
bitcoin_enable_qt_dbus=yes
@@ -468,8 +472,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
468472
[BITCOIN_QT_FAIL([${qt_lib_prefix}QuickControls2${qt_lib_suffix} $qt_version not found])])
469473
])
470474
BITCOIN_QT_CHECK([
471-
PKG_CHECK_MODULES([QT_QUICKTEST], [${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_QUICKTEST_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_QUICKTEST_LIBS $QT_LIBS"],
472-
[BITCOIN_QT_FAIL([${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version not found])])
475+
PKG_CHECK_MODULES([QT_QUICKTEST], [${qt_lib_prefix}QuickTest${qt_lib_suffix} $qt_version], [QT_QMLTEST_INCLUDES="$QT_QUICKTEST_CFLAGS"; have_quick_test=yes],[have_quick_test=no])
473476
])
474477
475478
AC_DEFINE([USE_QML], [1], [Define to 1 to use QML-based GUI])

configure.ac

+11-1
Original file line numberDiff line numberDiff line change
@@ -1812,8 +1812,9 @@ fi
18121812

18131813
dnl these are only used when qt is enabled
18141814
BUILD_TEST_QT=""
1815+
BUILD_TEST_QML=""
18151816
if test "$use_qml" != "no"; then
1816-
use_gui_tests=no
1817+
bitcoin_enable_qt_test=no
18171818
fi
18181819
if test "$bitcoin_enable_qt" != "no"; then
18191820
dnl enable dbus support
@@ -1849,6 +1850,14 @@ if test "$bitcoin_enable_qt" != "no"; then
18491850
else
18501851
AC_MSG_RESULT([no])
18511852
fi
1853+
1854+
AC_MSG_CHECKING([whether to build qml/test_bitcoin-qt])
1855+
if test "$use_gui_tests$bitcoin_enable_qml_test" = "yesyes"; then
1856+
AC_MSG_RESULT([yes])
1857+
BUILD_TEST_QML="yes"
1858+
else
1859+
AC_MSG_RESULT([no])
1860+
fi
18521861
fi
18531862

18541863
AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"])
@@ -1889,6 +1898,7 @@ AM_CONDITIONAL([ENABLE_FUZZ], [test "$enable_fuzz" = "yes"])
18891898
AM_CONDITIONAL([ENABLE_FUZZ_BINARY], [test "$enable_fuzz_binary" = "yes"])
18901899
AM_CONDITIONAL([ENABLE_QT], [test "$bitcoin_enable_qt" = "yes"])
18911900
AM_CONDITIONAL([ENABLE_QT_TESTS], [test "$BUILD_TEST_QT" = "yes"])
1901+
AM_CONDITIONAL([ENABLE_QML_TESTS], [test "$BUILD_TEST_QML" = "yes"])
18921902
AM_CONDITIONAL([ENABLE_BENCH], [test "$use_bench" = "yes"])
18931903
AM_CONDITIONAL([USE_QRCODE], [test "$use_qr" = "yes"])
18941904
AM_CONDITIONAL([USE_LCOV], [test "$use_lcov" = "yes"])

src/Makefile.am

+4-1
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,14 @@ endif
11041104

11051105
if ENABLE_QT
11061106
include Makefile.qt.include
1107-
include Makefile.qmltest.include
11081107
endif
11091108

11101109
if ENABLE_QT_TESTS
11111110
include Makefile.qttest.include
11121111
endif
11131112

1113+
if ENABLE_QML_TESTS
1114+
include Makefile.qmltest.include
1115+
endif
1116+
11141117
include Makefile.univalue.include

src/Makefile.qmltest.include

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ TEST_QML_MOC_CPP = qml/test/moc_onboardingtests.cpp
1010
TEST_QML_H = qml/test/onboardingtests.h qml/test/imageprovider.h
1111

1212
qml_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
13-
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(QT_QUICKTEST_INCLUDES) $(BOOST_CPPFLAGS)
13+
$(QT_INCLUDES) $(QT_TEST_INCLUDES) $(QT_QUICKTEST_INCLUDES) $(BOOST_CPPFLAGS) $(QT_QUICKTEST_CFLAGS)
1414

1515
qml_test_test_bitcoin_qt_SOURCES = \
1616
qml/test/onboardingtests.cpp \
@@ -24,7 +24,7 @@ qml_test_test_bitcoin_qt_LDADD = $(QT_QUICKTEST_LIBS) $(QT_TEST_LIBS) $(QT_LIBS)
2424
qml_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)
2525
qml_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
2626

27-
CLEAN_BITCOIN_QML_TEST = $(TEST_QML_MOC_CPP) qml/test/*.gcda qml/test/*.gcno
27+
CLEAN_BITCOIN_QML_TEST = $(TEST_QML_MOC_CPP)
2828

2929
CLEANFILES += $(CLEAN_BITCOIN_QML_TEST)
3030

0 commit comments

Comments
 (0)