Statically link libtimecode into libmidi++ instead of libardour
authorTim Mayberry <mojofunk@gmail.com>
Sat, 19 Oct 2013 23:27:35 +0000 (09:27 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Sat, 19 Oct 2013 23:27:35 +0000 (09:27 +1000)
This is necessary to get the libmidi++ test to work as libmidi++ has
unresolved symbols in libtimecode. This was not a problem when libtimecode
was statically linked into libardour if the executable depended on both
libtimecode and libardour as the symbols would get resolved.

This is not true for the midi++ test case as it doesn't depend on libardour

Also as libmidi++ only references symbols from one object file in the
libtimecode static archive only that object file gets included/exported
from libmidi++.

This is fixed by adding a dummy reference to a symbol in the other object
file in the libtimecode static archive.

libs/ardour/wscript
libs/midi++2/mmc.cc
libs/midi++2/wscript

index 33351bd8b1b3bff37bffdf9d25942d3f76d64636..82a4af63881a9d8e633a7999f5d66379e3dba8f3 100644 (file)
@@ -341,7 +341,7 @@ def build(bld):
                         'OSX','BOOST','CURL','DL']
     obj.use          = ['libpbd','libmidipp','libevoral','libvamphost',
                         'libvampplugin','libtaglib','librubberband',
-                        'libaudiographer', 'ltc', 'timecode' ]
+                        'libaudiographer', 'ltc', 'timecode_includes' ]
     obj.vnum         = LIBARDOUR_LIB_VERSION
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
     obj.defines      += [
index b93dc0f260503bb5e84088683caa1296ba2cdaa7..a3f8f01fe429a9ddac80ac11a1772d0a9d90f19c 100644 (file)
@@ -22,6 +22,7 @@
 #include <map>
 
 #include "timecode/time.h"
+#include "timecode/bbt_time.h"
 
 #include "pbd/error.h"
 
@@ -33,6 +34,13 @@ using namespace std;
 using namespace MIDI;
 using namespace PBD;
 
+/**
+ * As libtimecode is linked statically to libmidi++ this
+ * is necessary to pull in all the symbols from libtimecode
+ * so they are exported for other users of libtimecode.
+ */
+double tmp = Timecode::BBT_Time::ticks_per_beat;
+
 static std::map<int,string> mmc_cmd_map;
 static void build_mmc_cmd_map ()
 {
index b500bcaa4eddcd6b66e893532b19f1f35019dd61..c05075a5f180b03990643d58c496c9960dc64b1a 100644 (file)
@@ -76,7 +76,7 @@ def build(bld):
     obj.name         = 'libmidipp'
     obj.target       = 'midipp'
     obj.uselib       = 'GLIBMM SIGCPP XML JACK OSX'
-    obj.use          = 'libpbd libevoral timecode_includes'
+    obj.use          = 'libpbd libevoral timecode'
     obj.vnum         = LIBMIDIPP_LIB_VERSION
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')