summaryrefslogtreecommitdiff
path: root/libs/midi++2
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-10-18 11:50:44 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-10-18 11:50:44 -0400
commitf85c67501c2bef578eeb53741d0dfecaa0c723df (patch)
tree2704e1cbf2ed747c996bb48b1433298e62d4e331 /libs/midi++2
parent683496c501641fb5d7d47bdf9064aed72755ca61 (diff)
reverse the visibility.h files assumptions that we don't build shared libs by default
This avoids having to define define LIBFOO_DLL=1 all over the place. If we ever go with static libs we will need to define LIBFOO_STATIC=1 but hopefully in some central location like the top level wscript. Oh, and I also dropped support for gcc older than version 4.x because ardour will already not build on such an old version.
Diffstat (limited to 'libs/midi++2')
-rw-r--r--libs/midi++2/midi++/libmidi_visibility.h30
-rw-r--r--libs/midi++2/wscript3
2 files changed, 13 insertions, 20 deletions
diff --git a/libs/midi++2/midi++/libmidi_visibility.h b/libs/midi++2/midi++/libmidi_visibility.h
index 62eebfe8e2..51b061bdd8 100644
--- a/libs/midi++2/midi++/libmidi_visibility.h
+++ b/libs/midi++2/midi++/libmidi_visibility.h
@@ -30,27 +30,21 @@
#define LIBMIDIPP_DLL_EXPORT __declspec(dllexport)
#define LIBMIDIPP_DLL_LOCAL
#else
- #if __GNUC__ >= 4
- #define LIBMIDIPP_DLL_IMPORT __attribute__ ((visibility ("default")))
- #define LIBMIDIPP_DLL_EXPORT __attribute__ ((visibility ("default")))
- #define LIBMIDIPP_DLL_LOCAL __attribute__ ((visibility ("hidden")))
- #else
- #define LIBMIDIPP_DLL_IMPORT
- #define LIBMIDIPP_DLL_EXPORT
- #define LIBMIDIPP_DLL_LOCAL
- #endif
+ #define LIBMIDIPP_DLL_IMPORT __attribute__ ((visibility ("default")))
+ #define LIBMIDIPP_DLL_EXPORT __attribute__ ((visibility ("default")))
+ #define LIBMIDIPP_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#endif
-#ifdef LIBMIDIPP_DLL // libmidi is a DLL
-#ifdef LIBMIDIPP_DLL_EXPORTS // defined if we are building the libmidi DLL (instead of using it)
- #define LIBMIDIPP_API LIBMIDIPP_DLL_EXPORT
+#ifdef LIBMIDIPP_STATIC // libmidi is not a DLL
+ #define LIBMIDIPP_API
+ #define LIBMIDIPP_LOCAL
#else
- #define LIBMIDIPP_API LIBMIDIPP_DLL_IMPORT
-#endif
-#define LIBMIDIPP_LOCAL LIBMIDIPP_DLL_LOCAL
-#else /* static lib, not DLL */
-#define LIBMIDIPP_API
-#define LIBMIDIPP_LOCAL
+ #ifdef LIBMIDIPP_DLL_EXPORTS // defined if we are building the libmidi DLL (instead of using it)
+ #define LIBMIDIPP_API LIBMIDIPP_DLL_EXPORT
+ #else
+ #define LIBMIDIPP_API LIBMIDIPP_DLL_IMPORT
+ #endif
+ #define LIBMIDIPP_LOCAL LIBMIDIPP_DLL_LOCAL
#endif
#endif /* __libmidi_libmidi_visibility_h__ */
diff --git a/libs/midi++2/wscript b/libs/midi++2/wscript
index 39a4411dc0..b500bcaa4e 100644
--- a/libs/midi++2/wscript
+++ b/libs/midi++2/wscript
@@ -62,8 +62,7 @@ def build(bld):
# Library
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
obj = bld.shlib(features = 'cxx cxxshlib', source=libmidi_sources)
- obj.defines = [ 'LIBMIDIPP_DLL=1', 'LIBMIDIPP_DLL_EXPORTS=1' ]
- obj.defines += [ 'LIBPBD_DLL=1', 'LIBEVORAL_DLL=1' ]
+ obj.defines = [ 'LIBMIDIPP_DLL_EXPORTS=1' ]
obj.cxxflags = [ '-fvisibility=hidden' ]
obj.cflags = [ '-fvisibility=hidden' ]
else: