Browse Source

Use SRATOM_STATIC instead of SRATOM_SHARED to control visibility

For consistency, this seems to be the most common convention.
zrythm_meson
David Robillard 2 years ago
parent
commit
07c361def5
  1. 19
      include/sratom/sratom.h
  2. 8
      wscript

19
include/sratom/sratom.h

@ -30,19 +30,12 @@ @@ -30,19 +30,12 @@
#include <stdbool.h>
#include <stdint.h>
#ifdef SRATOM_SHARED
# ifdef _WIN32
# define SRATOM_LIB_IMPORT __declspec(dllimport)
# define SRATOM_LIB_EXPORT __declspec(dllexport)
# else
# define SRATOM_LIB_IMPORT __attribute__((visibility("default")))
# define SRATOM_LIB_EXPORT __attribute__((visibility("default")))
# endif
# ifdef SRATOM_INTERNAL
# define SRATOM_API SRATOM_LIB_EXPORT
# else
# define SRATOM_API SRATOM_LIB_IMPORT
# endif
#if defined(_WIN32) && !defined(SRATOM_STATIC) && defined(SRATOM_INTERNAL)
# define SRATOM_API __declspec(dllexport)
#elif defined(_WIN32) && !defined(SRATOM_STATIC)
# define SRATOM_API __declspec(dllimport)
#elif defined(__GNUC__)
# define SRATOM_API __attribute__((visibility("default")))
#else
# define SRATOM_API
#endif

8
wscript

@ -121,7 +121,7 @@ def build(bld): @@ -121,7 +121,7 @@ def build(bld):
target = 'sratom-%s' % SRATOM_MAJOR_VERSION,
vnum = SRATOM_VERSION,
install_path = '${LIBDIR}',
defines = defines + ['SRATOM_SHARED', 'SRATOM_INTERNAL'],
defines = defines + ['SRATOM_INTERNAL'],
cflags = libflags)
# Static library
@ -136,7 +136,7 @@ def build(bld): @@ -136,7 +136,7 @@ def build(bld):
target = 'sratom-%s' % SRATOM_MAJOR_VERSION,
vnum = SRATOM_VERSION,
install_path = '${LIBDIR}',
defines = defines + ['SRATOM_INTERNAL'])
defines = defines + ['SRATOM_STATIC', 'SRATOM_INTERNAL'])
if bld.env.BUILD_TESTS:
test_libs = libs
@ -155,7 +155,7 @@ def build(bld): @@ -155,7 +155,7 @@ def build(bld):
name = 'libsratom_profiled',
target = 'sratom_profiled',
install_path = '',
defines = defines + ['SRATOM_INTERNAL'],
defines = defines + ['SRATOM_STATIC', 'SRATOM_INTERNAL'],
cflags = test_cflags,
linkflags = test_linkflags)
@ -168,7 +168,7 @@ def build(bld): @@ -168,7 +168,7 @@ def build(bld):
uselib = 'SERD SORD LV2',
target = 'test_sratom',
install_path = '',
defines = defines,
defines = defines + ['SRATOM_STATIC'],
cflags = test_cflags,
linkflags = test_linkflags)

Loading…
Cancel
Save