add -fvisibility=hidden to evoral, and make things work
[ardour.git] / libs / evoral / wscript
index e8bf097db2b7f129462eddc1fb73f6fb9a160525..569aa0fc6b406f7235f48d7b53e48c0fe1792fb1 100644 (file)
@@ -88,8 +88,20 @@ def build(bld):
     '''
 
     # Library
-    obj = bld(features = 'cxx cxxshlib')
-    obj.source         = lib_source
+    if bld.is_defined ('INTERNAL_SHARED_LIBS'):
+        obj              = bld.shlib(features = 'c cxx cshlib cxxshlib', source=lib_source)
+        # DLL exports for this library
+        obj.defines      = [ 'LIBEVORAL_DLL=1', 'LIBEVORAL_DLL_EXPORTS=1' ]
+        # DLL imports for other libraries
+        obj.defines     += [ 'LIBPBD_DLL=1' ]
+        obj.cxxflags     = [ '-fvisibility=hidden' ]
+        obj.cflags       = [ '-fvisibility=hidden' ]
+    else:
+        obj              = bld.stlib(features = 'c cxx cstlib cxxstlib', source=lib_source)
+        obj.cxxflags     = [ '-fPIC' ]
+        obj.cflags       = [ '-fPIC' ]
+        obj.defines      = [ ]
+
     obj.export_includes = ['.']
     obj.includes       = ['.', './src']
     obj.name           = 'libevoral'
@@ -98,7 +110,7 @@ def build(bld):
     obj.use            = 'libsmf libpbd'
     obj.vnum           = EVORAL_LIB_VERSION
     obj.install_path   = os.path.join(bld.env['LIBDIR'], 'ardour3')
-    obj.defines = ['PACKAGE="libevoral"' ]
+    obj.defines       += [ 'PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ]
 
     if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
         # Static library (for unit test code coverage)
@@ -117,13 +129,14 @@ def build(bld):
             obj.linkflags      = '-lgcov'
             obj.cflags         = [ '-fprofile-arcs',  '-ftest-coverage' ]
             obj.cxxflags       = [ '-fprofile-arcs',  '-ftest-coverage' ]
-        obj.defines        = ['PACKAGE="libevoral"' ]
+        obj.defines        = ['PACKAGE="libevoral"', 'EVORAL_MIDI_XML=1' ]
 
         # Unit tests
         obj              = bld(features = 'cxx cxxprogram')
         obj.source       = '''
                 test/SequenceTest.cpp
                 test/SMFTest.cpp
+                test/RangeTest.cpp
                 test/testrunner.cpp
         '''
         obj.includes     = ['.', './src']