[gspell: 3/4] build: have a helper Libtool library to unit test private classes



commit 68e411d417d07d6d6908d46b46d5221065d251ea
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Feb 4 14:52:10 2016 +0100

    build: have a helper Libtool library to unit test private classes
    
    Like in GtkSourceView.

 gspell/Makefile.am    |   29 ++++++++++++++++++++---------
 testsuite/Makefile.am |    2 +-
 2 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index ff56838..1e6ddc3 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -54,20 +54,31 @@ gspell_private_c_files =                    \
        gspell-text-region.c                    \
        gspell-utils.c
 
-lib_LTLIBRARIES = libgspell-1.la
+# Helper Libtool library, so that the private functions can be used in unit
+# tests.
+noinst_LTLIBRARIES = libgspell-core.la
 
-libgspell_1_la_SOURCES =               \
-       $(gspell_public_headers)        \
-       $(gspell_public_c_files)        \
+libgspell_core_la_SOURCES =            \
+       $(gspell_private_c_files)       \
        $(gspell_private_headers)       \
-       $(gspell_private_c_files)
+       $(gspell_public_c_files)        \
+       $(gspell_public_headers)
 
-# do not distribute generated files
-nodist_libgspell_1_la_SOURCES = \
+# Do not distribute generated files.
+nodist_libgspell_core_la_SOURCES = \
        $(BUILT_SOURCES)
 
-libgspell_1_la_LIBADD =        \
-       $(DEP_LIBS)     \
+libgspell_core_la_LDFLAGS = \
+       -no-undefined
+
+# The real library.
+lib_LTLIBRARIES = libgspell-1.la
+
+libgspell_1_la_SOURCES =
+
+libgspell_1_la_LIBADD =                \
+       libgspell-core.la       \
+       $(DEP_LIBS)             \
        $(GTK_MAC_LIBS)
 
 libgspell_1_la_LDFLAGS =                       \
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 17cdcfb..d22a7eb 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -5,7 +5,7 @@ AM_CPPFLAGS =                   \
 
 AM_LDFLAGS = $(WARN_LDFLAGS)
 
-LDADD = $(top_builddir)/gspell/libgspell-1.la  \
+LDADD = $(top_builddir)/gspell/libgspell-core.la       \
        $(DEP_LIBS)
 
 noinst_PROGRAMS = $(UNIT_TEST_PROGS)


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