From ffb9de6a291739f633208ca87a4a3a2b12205a31 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Tue, 22 Oct 2024 19:40:45 +0200 Subject: [PATCH] fix: link error for testcapi When building the library as a static library it tries to link testcapi using the C compiler and we get a link error because the C++ support is missing. We enable link of testcapi using C++ when shared library is disabled. --- configure.ac | 1 + tests/Makefile.am | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index ab9ab382..aeccaf14 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,7 @@ AS_IF([test "x$AR" = "xno"], [ ]) LT_INIT([win32-dll]) +AM_CONDITIONAL([enable_shared], [test "$enable_shared" = "yes"]) AC_CONFIG_MACRO_DIR([m4]) # Checks for header files. diff --git a/tests/Makefile.am b/tests/Makefile.am index 9283cde1..bf51eafa 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,9 @@ apinames_LDADD = $(top_builddir)/librtmidi.la testcapi_SOURCES = testcapi.c testcapi_LDADD = $(top_builddir)/librtmidi.la +if !enable_shared +testcapi_LINK = $(CXXLINK) +endif EXTRA_DIST = cmidiin.dsp midiout.dsp midiprobe.dsp qmidiin.dsp \ sysextest.dsp RtMidi.dsw