Skip to content

Commit

Permalink
build: move private symbols into a convenience library
Browse files Browse the repository at this point in the history
Since 99eb6a3 we no longer export any
private symbols. The tests do require those private symbols though.
Instead of compiling the source twice, as done in
f415452, create a convenience library
and link the tests against it.
  • Loading branch information
mbiebl committed Apr 7, 2016
1 parent 1b5d8a0 commit bdb2e2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 8 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ EXTRA_DIST = README.html

SUBDIRS = . tests

lib_LTLIBRARIES = libfastjson.la
lib_LTLIBRARIES = libfastjson.la
noinst_LTLIBRARIES = libfastjson-internal.la

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libfastjson.pc
Expand All @@ -29,20 +30,22 @@ libfastjson_la_LDFLAGS = \
-export-symbols-regex '^fjson_.*' \
-no-undefined \
@JSON_BSYMBOLIC_LDFLAGS@
libfastjson_la_LIBADD = libfastjson-internal.la

libfastjson_la_SOURCES = \
arraylist.c \
debug.c \
json_version.c \
json_object.c \
json_object_iterator.c \
json_tokener.c \
json_util.c \
json_util.c

libfastjson_internal_la_SOURCES = \
arraylist.c \
debug.c \
linkhash.c \
printbuf.c \
random_seed.c


uninstall-local:
rm -rf "$(DESTDIR)@includedir@/libfastjson"

Expand Down
9 changes: 4 additions & 5 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

LDADD= $(LIBJSON_LA)

LIBJSON_LA=$(top_builddir)/libfastjson.la
LDADD = $(top_builddir)/libfastjson.la \
$(top_builddir)/libfastjson-internal.la

TESTS=
TESTS+= test1.test
Expand Down Expand Up @@ -29,8 +28,8 @@ TESTS += chk_version
check_PROGRAMS += chk_version
chk_version_SOURCES = chk_version.c

test_printbuf_SOURCES = test_printbuf.c ../printbuf.c ../debug.c
test_set_serializer_SOURCES = test_set_serializer.c ../printbuf.c
test_printbuf_SOURCES = test_printbuf.c
test_set_serializer_SOURCES = test_set_serializer.c

# Note: handled by test1.test
check_PROGRAMS += test1Formatted
Expand Down

0 comments on commit bdb2e2b

Please sign in to comment.