diff options
-rw-r--r-- | include/lilv/lilv.h | 20 | ||||
-rw-r--r-- | wscript | 12 |
2 files changed, 14 insertions, 18 deletions
diff --git a/include/lilv/lilv.h b/include/lilv/lilv.h index b803cb1..ac34b81 100644 --- a/include/lilv/lilv.h +++ b/include/lilv/lilv.h @@ -29,22 +29,16 @@ #include <stdint.h> #include <stdio.h> -#ifdef LILV_SHARED -# ifdef _WIN32 -# define LILV_LIB_IMPORT __declspec(dllimport) -# define LILV_LIB_EXPORT __declspec(dllexport) -# else -# define LILV_LIB_IMPORT __attribute__((visibility("default"))) -# define LILV_LIB_EXPORT __attribute__((visibility("default"))) -# endif -# ifdef LILV_INTERNAL -# define LILV_API LILV_LIB_EXPORT -# else -# define LILV_API LILV_LIB_IMPORT -# endif +#if defined(_WIN32) && !defined(LILV_STATIC) && defined(LILV_INTERNAL) +# define LILV_API __declspec(dllexport) +#elif defined(_WIN32) && !defined(LILV_STATIC) +# define LILV_API __declspec(dllimport) +#elif defined(__GNUC__) +# define LILV_API __attribute__((visibility("default"))) #else # define LILV_API #endif + #if defined(__GNUC__) && \ (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) # define LILV_DEPRECATED __attribute__((__deprecated__)) @@ -352,7 +352,7 @@ def build(bld): target = 'lilv-%s' % LILV_MAJOR_VERSION, vnum = LILV_VERSION, install_path = '${LIBDIR}', - defines = ['LILV_SHARED', 'LILV_INTERNAL'], + defines = ['LILV_INTERNAL'], cflags = libflags, lib = lib, uselib = 'SERD SORD SRATOM LV2') @@ -367,7 +367,7 @@ def build(bld): target = 'lilv-%s' % LILV_MAJOR_VERSION, vnum = LILV_VERSION, install_path = '${LIBDIR}', - defines = defines + ['LILV_INTERNAL'], + defines = defines + ['LILV_STATIC', 'LILV_INTERNAL'], uselib = 'SERD SORD SRATOM LV2') # Python bindings @@ -406,7 +406,7 @@ def build(bld): name = p, target = 'test/%s.lv2/%s' % (p, p), install_path = None, - defines = defines, + defines = defines + ['LILV_STATIC'], cflags = test_cflags, linkflags = test_linkflags, lib = test_libs, @@ -423,7 +423,7 @@ def build(bld): includes = ['.', 'include', './src'], use = 'liblilv_profiled', install_path = None, - defines = defines, + defines = defines + ['LILV_STATIC'], cflags = test_cflags, linkflags = test_linkflags, lib = test_libs, @@ -446,7 +446,7 @@ def build(bld): name = 'liblilv_profiled', target = 'lilv_profiled', install_path = None, - defines = defines + ['LILV_INTERNAL'], + defines = defines + ['LILV_STATIC', 'LILV_INTERNAL'], cflags = test_cflags, linkflags = test_linkflags, lib = test_libs, @@ -468,6 +468,7 @@ def build(bld): target = 'test/' + test, install_path = None, defines = (defines + + ['LILV_STATIC'] + ['LILV_TEST_BUNDLE=\"%s/\"' % bpath] + ['LILV_TEST_DIR=\"%s/\"' % testdir]), cflags = test_cflags, @@ -483,6 +484,7 @@ def build(bld): uselib = 'SERD SORD SRATOM LV2', target = 'test/lilv_cxx_test', install_path = None, + defines = ['LILV_STATIC'], cxxflags = test_cflags, linkflags = test_linkflags) |