gnucash master: Build test-import-pending-matches as c++

Geert Janssens gjanssens at code.gnucash.org
Thu Aug 24 15:55:11 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/64f36323 (commit)
	from  https://github.com/Gnucash/gnucash/commit/29a92431 (commit)



commit 64f36323b23d6dc9eb2eab9eb2630f1efc0a64ef
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Aug 23 15:07:13 2017 +0200

    Build test-import-pending-matches as c++
    
    It depends on libgncmod-test-engine which needs c++ building/linking.
    Without this change the next commit would produce the following linker error:
    /usr/bin/ld: ../../../libgnucash/engine/test-core/.libs/libgncmod-test-engine.a(test-engine-stuff.o): undefined reference to symbol '__gxx_personality_v0@@CXXABI_1.3'
    /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
    
    Making the test compila as C++ solves the issue.
    For reference commit ff07762 and commit 5e7dd9 seem to be related and
    have additional explanations.

diff --git a/gnucash/import-export/test/CMakeLists.txt b/gnucash/import-export/test/CMakeLists.txt
index 07e872b..e411d24 100644
--- a/gnucash/import-export/test/CMakeLists.txt
+++ b/gnucash/import-export/test/CMakeLists.txt
@@ -19,8 +19,8 @@ GNC_ADD_TEST_WITH_GUILE(test-import-parse test-import-parse.c
 GNC_ADD_TEST(test-link-generic-import test-link.c
   GENERIC_IMPORT_TEST_INCLUDE_DIRS GENERIC_IMPORT_TEST_LIBS
 )
-GNC_ADD_TEST(test-import-pending-matches test-import-pending-matches.c
+GNC_ADD_TEST(test-import-pending-matches test-import-pending-matches.cpp
   GENERIC_IMPORT_TEST_INCLUDE_DIRS GENERIC_IMPORT_TEST_LIBS
 )
 SET_DIST_LIST(test_generic_import_DIST CMakeLists.txt Makefile.am
-        test-link.c test-import-parse.c test-import-pending-matches.c)
+        test-link.c test-import-parse.c test-import-pending-matches.cpp)
diff --git a/gnucash/import-export/test/Makefile.am b/gnucash/import-export/test/Makefile.am
index fa768ae..1c7d573 100644
--- a/gnucash/import-export/test/Makefile.am
+++ b/gnucash/import-export/test/Makefile.am
@@ -59,9 +59,10 @@ check_PROGRAMS = \
 
 noinst_PROGRAMS = $(TEST_PROGS) $(check_PROGRAMS)
 
-test_import_pending_matches_SOURCES = test-import-pending-matches.c
+test_import_pending_matches_SOURCES = test-import-pending-matches.cpp
 
 test_import_pending_matches_LDADD = \
+  ${top_builddir}/libgnucash/core-utils/libgnc-core-utils.la \
   ${top_builddir}/libgnucash/engine/libgncmod-engine.la \
   ../libgncmod-generic-import.la \
   ${top_builddir}/libgnucash/engine/test-core/libgncmod-test-engine.la \
diff --git a/gnucash/import-export/test/test-import-pending-matches.c b/gnucash/import-export/test/test-import-pending-matches.cpp
similarity index 99%
rename from gnucash/import-export/test/test-import-pending-matches.c
rename to gnucash/import-export/test/test-import-pending-matches.cpp
index 98a7543..5db4bdf 100644
--- a/gnucash/import-export/test/test-import-pending-matches.c
+++ b/gnucash/import-export/test/test-import-pending-matches.cpp
@@ -1,3 +1,4 @@
+extern "C" {
 #include <config.h>
 #include <unittest-support.h>
 
@@ -7,6 +8,7 @@
 #include "import-pending-matches.h"
 #include "Split.h"
 #include "test-engine-stuff.h"
+}
 
 static const gchar *suitename = "/import-export/import-pending-matches";
 



Summary of changes:
 gnucash/import-export/test/CMakeLists.txt                             | 4 ++--
 gnucash/import-export/test/Makefile.am                                | 3 ++-
 ...{test-import-pending-matches.c => test-import-pending-matches.cpp} | 2 ++
 3 files changed, 6 insertions(+), 3 deletions(-)
 rename gnucash/import-export/test/{test-import-pending-matches.c => test-import-pending-matches.cpp} (99%)



More information about the gnucash-changes mailing list