Skip to content

Commit

Permalink
libs: fix API export/import and 'inconsistent linkage' on MSVC
Browse files Browse the repository at this point in the history
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
  • Loading branch information
tp-m committed Sep 24, 2018
1 parent cfc8d7e commit dc29bc4
Show file tree
Hide file tree
Showing 49 changed files with 109 additions and 54 deletions.
2 changes: 1 addition & 1 deletion common
Submodule common updated from ed78be to cd1dee
8 changes: 7 additions & 1 deletion configure.ac
Expand Up @@ -841,7 +841,13 @@ fi
AC_SUBST(DEPRECATED_CFLAGS)

VISIBILITY_CFLAGS=""
AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
AS_COMPILER_FLAG([-fvisibility=hidden], [
VISIBILITY_CFLAGS="-fvisibility=hidden"
AC_DEFINE(GST_API_EXPORT, [extern __attribute__ ((visibility ("default")))], [public symbol export define])
], [
VISIBILITY_CFLAGS=""
AC_DEFINE(GST_API_EXPORT, [extern], [public symbol export define])
])
AC_SUBST(VISIBILITY_CFLAGS)

VISIBILITY_CXXFLAGS=""
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/allocators/Makefile.am
Expand Up @@ -17,7 +17,7 @@ libgstallocators_@GST_API_VERSION@_la_SOURCES = \
gstdmabuf.c

libgstallocators_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM)
libgstallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_ALLOCATORS
libgstallocators_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

if HAVE_INTROSPECTION
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/allocators/allocators-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_ALLOCATORS_API
#define GST_ALLOCATORS_API GST_EXPORT
#ifdef BUILDING_GST_ALLOCATORS
#define GST_ALLOCATORS_API GST_API_EXPORT /* from config.h */
#else
#define GST_ALLOCATORS_API GST_API_IMPORT
#endif

#endif /* __GST_ALLOCATORS_PRELUDE_H__ */
2 changes: 1 addition & 1 deletion gst-libs/gst/allocators/meson.build
Expand Up @@ -10,7 +10,7 @@ install_headers(gst_allocators_headers, subdir : 'gstreamer-1.0/gst/allocators/'
gst_allocators_sources = [ 'gstdmabuf.c', 'gstfdmemory.c', 'gstphysmemory.c']
gstallocators = library('gstallocators-@0@'.format(api_version),
gst_allocators_sources,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_ALLOCATORS'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/app/Makefile.am
Expand Up @@ -17,7 +17,7 @@ include $(top_srcdir)/common/gst-glib-gen.mak
libgstapp_@GST_API_VERSION@_la_SOURCES = gstappsrc.c gstappsink.c
nodist_libgstapp_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libgstapp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS)
$(GST_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_APP
libgstapp_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS)
libgstapp_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/app/app-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_APP_API
#define GST_APP_API GST_EXPORT
#ifdef BUILDING_GST_APP
#define GST_APP_API GST_API_EXPORT /* from config.h */
#else
#define GST_APP_API GST_API_IMPORT
#endif

#endif /* __GST_APP_PRELUDE_H__ */
3 changes: 2 additions & 1 deletion gst-libs/gst/app/meson.build
Expand Up @@ -9,6 +9,7 @@ install_headers(app_headers, subdir : 'gstreamer-1.0/gst/app/')

app_enums = gnome.mkenums_simple('app-enumtypes',
sources : app_mkenum_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/app/app-prelude.h>',
decorator : 'GST_APP_API',
install_header: true,
Expand All @@ -20,7 +21,7 @@ app_gen_sources = [gstapp_h]

gstapp = library('gstapp-@0@'.format(api_version),
app_sources, gstapp_h, gstapp_c,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_APP'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/audio/Makefile.am
Expand Up @@ -104,7 +104,7 @@ noinst_HEADERS = \
audio-resampler-neon.h

libgstaudio_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \
$(ORC_CFLAGS)
$(ORC_CFLAGS) -DBUILDING_GST_AUDIO
libgstaudio_@GST_API_VERSION@_la_LIBADD = \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_API_VERSION@.la \
$(GST_BASE_LIBS) $(GST_LIBS) $(LIBM) $(ORC_LIBS)
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/audio/audio-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_AUDIO_API
#define GST_AUDIO_API GST_EXPORT
#ifdef BUILDING_GST_AUDIO
#define GST_AUDIO_API GST_API_EXPORT /* from config.h */
#else
#define GST_AUDIO_API GST_API_IMPORT
#endif

#endif /* __GST_AUDIO_PRELUDE_H__ */
3 changes: 2 additions & 1 deletion gst-libs/gst/audio/meson.build
Expand Up @@ -64,6 +64,7 @@ install_headers(audio_headers, subdir : 'gstreamer-1.0/gst/audio/')

audio_enums = gnome.mkenums_simple('audio-enumtypes',
sources : audio_mkenum_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/audio/audio-prelude.h>',
decorator : 'GST_AUDIO_API',
install_header: true,
Expand Down Expand Up @@ -140,7 +141,7 @@ endif

gstaudio = library('gstaudio-@0@'.format(api_version),
audio_src, gstaudio_h, gstaudio_c, orc_c, orc_h,
c_args : gst_plugins_base_args + simd_cargs,
c_args : gst_plugins_base_args + simd_cargs + ['-DBUILDING_GST_AUDIO'],
include_directories: [configinc, libsinc],
link_with : simd_dependencies,
version : libversion,
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/fft/Makefile.am
Expand Up @@ -41,7 +41,7 @@ libgstfft_@GST_API_VERSION@_la_SOURCES = \
kiss_fftr_f64.c

libgstfft_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM)
libgstfft_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstfft_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_FFT
libgstfft_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

EXTRA_DIST = kiss_version
6 changes: 4 additions & 2 deletions gst-libs/gst/fft/fft-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_FFT_API
#define GST_FFT_API GST_EXPORT
#ifdef BUILDING_GST_FFT
#define GST_FFT_API GST_API_EXPORT /* from config.h */
#else
#define GST_FFT_API GST_API_IMPORT
#endif

#endif /* __GST_FFT_PRELUDE_H__ */
2 changes: 1 addition & 1 deletion gst-libs/gst/fft/meson.build
Expand Up @@ -27,7 +27,7 @@ install_headers(fft_headers, subdir : 'gstreamer-1.0/gst/fft/')

gstfft = library('gstfft-@0@'.format(api_version),
fft_sources,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_FFT'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/Makefile.am
Expand Up @@ -155,7 +155,7 @@ configexecincludedir = $(libdir)/gstreamer-@GST_API_VERSION@/include/gst/gl
nodist_configexecinclude_HEADERS = $(built_sys_header_configure)

libgstgl_@GST_API_VERSION@_la_CFLAGS = \
-DGST_EXPORTS \
-DBUILDING_GST_GL \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/android/Makefile.am
Expand Up @@ -11,6 +11,7 @@ noinst_HEADERS = \
libgstgl_android_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/cocoa/Makefile.am
Expand Up @@ -21,6 +21,7 @@ libgstgl_cocoainclude_HEADERS = \
libgstgl_cocoa_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/dispmanx/Makefile.am
Expand Up @@ -11,6 +11,7 @@ noinst_HEADERS = \
libgstgl_dispmanx_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/eagl/Makefile.am
Expand Up @@ -13,6 +13,7 @@ noinst_HEADERS = \
libgstgl_eagl_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/egl/Makefile.am
Expand Up @@ -22,6 +22,7 @@ libgstgl_eglinclude_HEADERS = \
libgstgl_egl_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/gbm/Makefile.am
Expand Up @@ -15,6 +15,7 @@ noinst_HEADERS = \
libgstgl_gbm_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/gl/gl-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_GL_API
#define GST_GL_API GST_EXPORT
#ifdef BUILDING_GST_GL
#define GST_GL_API GST_API_EXPORT /* from config.h */
#else
#define GST_GL_API GST_API_IMPORT
#endif

#endif /* __GST_GL_PRELUDE_H__ */
4 changes: 2 additions & 2 deletions gst-libs/gst/gl/meson.build
Expand Up @@ -877,8 +877,8 @@ if build_gstgl

gstgl = library('gstgl-' + api_version,
gl_sources,
c_args : gst_plugins_base_args + gl_cpp_args,
objc_args : gst_plugins_base_args + gl_cpp_args + gl_objc_args,
c_args : gst_plugins_base_args + gl_cpp_args + ['-DBUILDING_GST_GL'],
objc_args : gst_plugins_base_args + gl_cpp_args + gl_objc_args + ['-DBUILDING_GST_GL'],
include_directories : [configinc, libsinc, gl_includes],
version : libversion,
soversion : soversion,
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/viv-fb/Makefile.am
Expand Up @@ -17,6 +17,7 @@ libgstgl_viv_fbinclude_HEADERS = \
libgstgl_viv_fb_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/wayland/Makefile.am
Expand Up @@ -18,6 +18,7 @@ libgstgl_waylandinclude_HEADERS = \
libgstgl_wayland_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/win32/Makefile.am
Expand Up @@ -14,9 +14,9 @@ noinst_HEADERS += gstglcontext_wgl.h
endif

libgstgl_win32_la_CFLAGS = \
-DGST_EXPORTS \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/x11/Makefile.am
Expand Up @@ -23,6 +23,7 @@ endif
libgstgl_x11_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_GL \
$(GL_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/pbutils/Makefile.am
Expand Up @@ -54,7 +54,7 @@ libgstpbutils_@GST_API_VERSION@_la_LIBADD = \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_API_VERSION@.la \
$(GST_BASE_LIBS) \
$(GST_LIBS)
libgstpbutils_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstpbutils_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_PBUTILS
libgstpbutils_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

BUILT_SOURCES = \
Expand Down
3 changes: 2 additions & 1 deletion gst-libs/gst/pbutils/meson.build
Expand Up @@ -40,6 +40,7 @@ pbutils_mkenum_headers = pbutils_headers

pbutils_enums = gnome.mkenums_simple('pbutils-enumtypes',
sources : pbutils_mkenum_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/pbutils/pbutils-prelude.h>',
decorator : 'GST_PBUTILS_API',
install_header: true,
Expand All @@ -50,7 +51,7 @@ gstpbutils_h = pbutils_enums[1]
gstpbutils_deps = [video_dep, audio_dep, tag_dep]
pbutils = library('gstpbutils-@0@'.format(api_version),
pbutils_sources, gstpbutils_c, gstpbutils_h,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_PBUTILS'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/pbutils/pbutils-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_PBUTILS_API
#define GST_PBUTILS_API GST_EXPORT
#ifdef BUILDING_GST_PBUTILS
#define GST_PBUTILS_API GST_API_EXPORT /* from config.h */
#else
#define GST_PBUTILS_API GST_API_IMPORT
#endif

#ifndef GST_DISABLE_DEPRECATED
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/riff/Makefile.am
Expand Up @@ -18,7 +18,7 @@ libgstriff_@GST_API_VERSION@_la_LIBADD = \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_API_VERSION@.la \
$(GST_BASE_LIBS) $(GST_LIBS)

libgstriff_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstriff_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_RIFF
libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

# *** GIR DISABLED for this library ***
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/riff/meson.build
Expand Up @@ -16,7 +16,7 @@ install_headers(riff_headers, subdir : 'gstreamer-1.0/gst/riff/')
riff_deps = [audio_dep, tag_dep]
gstriff = library('gstriff-@0@'.format(api_version),
riff_sources,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_RIFF'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/riff/riff-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_RIFF_API
#define GST_RIFF_API GST_EXPORT
#ifdef BUILDING_GST_RIFF
#define GST_RIFF_API GST_API_EXPORT /* from config.h */
#else
#define GST_RIFF_API GST_API_IMPORT
#endif

#endif /* __GST_RIFF_PRELUDE_H__ */
2 changes: 1 addition & 1 deletion gst-libs/gst/rtp/Makefile.am
Expand Up @@ -25,7 +25,7 @@ libgstrtp_@GST_API_VERSION@_la_SOURCES = gstrtpbuffer.c \
built_sources = gstrtp-enumtypes.c
built_headers = gstrtp-enumtypes.h

libgstrtp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstrtp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_RTP
libgstrtp_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
libgstrtp_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)

Expand Down
3 changes: 2 additions & 1 deletion gst-libs/gst/rtp/meson.build
Expand Up @@ -24,6 +24,7 @@ install_headers(rtp_headers, subdir : 'gstreamer-1.0/gst/rtp/')

rtp_enums = gnome.mkenums_simple('gstrtp-enumtypes',
sources : rtp_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/rtp/rtp-prelude.h>',
decorator : 'GST_RTP_API',
install_header: true,
Expand All @@ -34,7 +35,7 @@ gstrtp_enum_h = rtp_enums[1]
gstrtp_deps = [audio_dep, gst_base_dep]
gst_rtp = library('gstrtp-@0@'.format(api_version),
rtp_sources, gstrtp_enum_c, gstrtp_enum_h,
c_args : gst_plugins_base_args,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_RTP'],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
Expand Down
6 changes: 4 additions & 2 deletions gst-libs/gst/rtp/rtp-prelude.h
Expand Up @@ -24,8 +24,10 @@

#include <gst/gst.h>

#ifndef GST_RTP_API
#define GST_RTP_API GST_EXPORT
#ifdef BUILDING_GST_RTP
#define GST_RTP_API GST_API_EXPORT /* from config.h */
#else
#define GST_RTP_API GST_API_IMPORT
#endif

#endif /* __GST_RTP_PRELUDE_H__ */
2 changes: 1 addition & 1 deletion gst-libs/gst/rtsp/Makefile.am
Expand Up @@ -34,7 +34,7 @@ nodist_libgstrtspinclude_HEADERS = gstrtsp-enumtypes.h
#gstrtspextwms.c
#rtspextreal.c

libgstrtsp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GIO_CFLAGS)
libgstrtsp_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GIO_CFLAGS) -DBUILDING_GST_RTSP
libgstrtsp_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(GIO_LIBS) $(LIBM)
libgstrtsp_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) $(WIN32_LIBS)

Expand Down

0 comments on commit dc29bc4

Please sign in to comment.