WIP: ges: fix API export/import and 'inconsistent linkage' on MSVC
authorTim-Philipp Müller <tim@centricular.com>
Mon, 24 Sep 2018 14:41:24 +0000 (15:41 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Sat, 15 Dec 2018 00:14:51 +0000 (00:14 +0000)
Export GES library API in headers when we're building the
library itself, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

Fix up some missing config.h includes when building the lib which
is needed to get the export api define from config.h

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/42

65 files changed:
configure.ac
ges/Makefile.am
ges/ges-asset.c
ges/ges-audio-source.c
ges/ges-audio-test-source.c
ges/ges-audio-track.c
ges/ges-audio-transition.c
ges/ges-audio-uri-source.c
ges/ges-auto-transition.c
ges/ges-base-effect-clip.c
ges/ges-base-effect.c
ges/ges-base-transition-clip.c
ges/ges-base-xml-formatter.c
ges/ges-clip-asset.c
ges/ges-clip.c
ges/ges-command-line-formatter.c
ges/ges-container.c
ges/ges-effect-asset.c
ges/ges-effect-clip.c
ges/ges-effect.c
ges/ges-enums.c
ges/ges-extractable.c
ges/ges-formatter.c
ges/ges-group.c
ges/ges-image-source.c
ges/ges-layer.c
ges/ges-meta-container.c
ges/ges-multi-file-source.c
ges/ges-operation-clip.c
ges/ges-operation.c
ges/ges-overlay-clip.c
ges/ges-pipeline.c
ges/ges-pitivi-formatter.c
ges/ges-prelude.h
ges/ges-project.c
ges/ges-screenshot.c
ges/ges-smart-adder.c
ges/ges-smart-video-mixer.c
ges/ges-source-clip.c
ges/ges-source.c
ges/ges-structure-parser.c
ges/ges-structured-interface.c
ges/ges-test-clip.c
ges/ges-text-overlay-clip.c
ges/ges-text-overlay.c
ges/ges-timeline-element.c
ges/ges-timeline.c
ges/ges-title-clip.c
ges/ges-title-source.c
ges/ges-track-element-asset.c
ges/ges-track-element.c
ges/ges-track.c
ges/ges-transition-clip.c
ges/ges-transition.c
ges/ges-uri-asset.c
ges/ges-uri-clip.c
ges/ges-utils.c
ges/ges-video-source.c
ges/ges-video-test-source.c
ges/ges-video-track.c
ges/ges-video-transition.c
ges/ges-video-uri-source.c
ges/ges-xml-formatter.c
ges/meson.build
meson.build

index ea89600..95dd728 100644 (file)
@@ -353,7 +353,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)
 
 dnl disable strict aliasing
index dae513f..18d2444 100644 (file)
@@ -155,7 +155,7 @@ noinst_HEADERS = \
 libges_@GST_API_VERSION@_la_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) \
                $(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
                $(GST_CFLAGS) $(XML_CFLAGS) $(GIO_CFLAGS) $(GST_VALIDATE_CFLAGS) \
-               -DG_LOG_DOMAIN=\"GES\"
+               -DG_LOG_DOMAIN=\"GES\" -DBUILDING_GES
 libges_@GST_API_VERSION@_la_LIBADD = $(GST_PBUTILS_LIBS) \
                $(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) \
                $(GST_BASE_LIBS) $(GST_LIBS) $(XML_LIBS) $(GIO_LIBS) $(GST_VALIDATE_LIBS)
index a7d5d30..9503b3e 100644 (file)
@@ -82,6 +82,9 @@
  * ges_asset_request_async(). All the #GESAssets are cached and thus any asset that has already
  * been created can be requested again without overhead.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges.h"
 #include "ges-internal.h"
index 1588a1e..8997107 100644 (file)
@@ -48,6 +48,9 @@
  * </tgroup>
  * </informaltable>
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges/ges-meta-container.h"
index 03831ad..81627ab 100644 (file)
@@ -27,6 +27,9 @@
  * output silence. Useful for testing pipelines, or to fill gaps in an audio
  * track.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index 68bc2f7..1ac8af0 100644 (file)
@@ -36,6 +36,9 @@
  * - rate: 44100
  * - layout: interleaved
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-smart-adder.h"
index 10c70e2..3a94876 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESAudioTransition
  * @short_description: implements audio crossfade transition
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index 11c3675..755d6e0 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESAudioUriSource
  * @short_description: outputs a single audio stream from a given file
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-utils.h"
 #include "ges-internal.h"
index 18e41cf..37ea759 100644 (file)
@@ -22,6 +22,9 @@
  *
  * NOTE: This is for internal use exclusively
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-auto-transition.h"
 #include "ges-internal.h"
index 18e03d1..4cf1e65 100644 (file)
@@ -25,6 +25,9 @@
  * The effect will be applied on the sources that have lower priorities
  * (higher number) between the inpoint and the end of it.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index ee11d6c..b604833 100644 (file)
@@ -23,6 +23,9 @@
  * @short_description: adds an effect to a stream in a GESSourceClip or a
  * GESLayer
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <glib/gprintf.h>
 
index b2347bf..ac3a47c 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESBaseTransitionClip
  * @short_description: Base classes for transitions
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index 414fc0c..5e1fe77 100644 (file)
@@ -17,6 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges.h"
 #include "ges-internal.h"
index 4561084..e749c8a 100644 (file)
@@ -26,6 +26,9 @@
  * it is mostly used to get information about the #GESTrackType-s the objects extracted
  * from it can potentialy create #GESTrackElement for.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-clip-asset.h"
 
index 1393516..a7110a1 100644 (file)
@@ -31,6 +31,9 @@
  * Keeps a reference to the #GESTrackElement(s) it created and
  * sets/updates their properties.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-clip.h"
 #include "ges.h"
index 4dbc181..afca778 100644 (file)
@@ -17,6 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-command-line-formatter.h"
 
index 06f2a25..35abcbf 100644 (file)
@@ -24,6 +24,9 @@
  * @short_description: Base Class for objects responsible for controlling other
  * GESTimelineElement-s
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-container.h"
 #include "ges.h"
index b836ed5..120dbf4 100644 (file)
@@ -24,6 +24,9 @@
  * This is internal, and implementation details, so we are not showing it in the
  * documentation
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-effect-asset.h"
 #include "ges-track-element.h"
index fab0370..f43f2f4 100644 (file)
@@ -26,6 +26,9 @@
  * The effect will be applied on the sources that have lower priorities
  * (higher number) between the inpoint and the end of it.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index 84ef696..a2a80f4 100644 (file)
@@ -23,6 +23,9 @@
  * @short_description: adds an effect build from a parse-launch style
  * bin description to a stream in a GESSourceClip or a GESLayer
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-extractable.h"
index 440657e..c4072ff 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GES Enumerations
  * @short_description: Various enums for the Gstreamer Editing Services
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-enums.h"
 #include "ges-internal.h"
index 77f56d6..9d7d3f1 100644 (file)
  *
  * FIXME: Long description needed
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "ges-asset.h"
 #include "ges-internal.h"
 #include "ges-extractable.h"
index 5ff9f04..2bc22e2 100644 (file)
@@ -24,6 +24,9 @@
  * @short_description: Timeline saving and loading.
  *
  **/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/gst.h>
 #include <gio/gio.h>
index f676269..a0fb24e 100644 (file)
@@ -31,6 +31,9 @@
  * should be instaciated to group the various #GESTimelineElement passed
  * in parametter.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-group.h"
 #include "ges.h"
index 54ebcb4..b4c3eb4 100644 (file)
@@ -28,6 +28,9 @@
  * chosen will be determined by the in-point property on the track element. For
  * image files, do not set the in-point property.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index fcc036c..ad33c02 100644 (file)
@@ -30,6 +30,9 @@
  * priorities of individual Clips. Two layers should not have the
  * same priority within a given timeline.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-layer.h"
index 883eb98..e9a3522 100644 (file)
@@ -17,6 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <glib-object.h>
 #include <gst/gst.h>
index ce9e19d..f6b6c4b 100644 (file)
  * Outputs the video stream from a given image sequence. The start frame
  * chosen will be determined by the in-point property on the track element.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include "ges-internal.h"
index 9b81168..d8be92d 100644 (file)
@@ -25,6 +25,9 @@
  *
  * Operations are any kind of object that both outputs AND consumes data.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges.h"
 #include "ges-internal.h"
index 6bf10cd..15a7102 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESOperation
  * @short_description: Base Class for effects and overlays
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index 51e0488..8ab9695 100644 (file)
@@ -30,6 +30,9 @@
  * Transitions, which change from one source to another over time, are
  * not considered overlays.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-operation-clip.h"
index 9dda930..de68b58 100644 (file)
@@ -27,6 +27,9 @@
  * in a simple fashion.
  * Its usage is inspired by the 'playbin' element from gst-plugins-base.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/gst.h>
 #include <gst/video/videooverlay.h>
index 76cdda0..38fd0a2 100644 (file)
  *
  * Deprecated: 1.0
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#undef VERSION
+#endif
 
 #include <libxml/xmlreader.h>
 #include <libxml/tree.h>
@@ -41,7 +45,7 @@
 #include <ges/ges.h>
 
 /* The Pitivi etree formatter is 0.1 we set GES one to 0.2 */
-#define VERSION "0.2"
+//#define VERSION "0.2"
 #define DOUBLE_VERSION 0.2
 
 #undef GST_CAT_DEFAULT
index fc6c940..ccfff57 100644 (file)
 #include <gst/gst.h>
 
 #ifndef GES_API
-#define GES_API GST_EXPORT
+# ifdef BUILDING_GES
+#  define GES_API GST_API_EXPORT         /* from config.h */
+# else
+#  define GES_API GST_API_IMPORT
+# endif
 #endif
 
 #endif /* __GST_GES_PRELUDE_H__ */
index e4d9f20..4ad6281 100644 (file)
  * a set of signals. Also it handles problem such as missing files/missing
  * #GstElement and lets you try to recover from those.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "ges.h"
 #include "ges-internal.h"
 
index 755aae7..1a99a5e 100644 (file)
@@ -17,6 +17,9 @@
  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/gst.h>
 #include <gst/video/video.h>
index 5d8b2bc..85ea017 100644 (file)
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.";
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <gst/audio/audio.h>
 
 #include "ges-types.h"
index 6315f41..aa39651 100644 (file)
@@ -16,6 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.";
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "gstframepositioner.h"
 #include "ges-types.h"
index 24dd0bf..21c9f95 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESSourceClip
  * @short_description: Base Class for sources of a GESLayer
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-clip.h"
index 90119e6..e70c4e5 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESSource
  * @short_description: Base Class for single-media sources
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges/ges-meta-container.h"
index ae05622..bcd2a24 100644 (file)
@@ -17,6 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-structure-parser.h"
 
index 1e00a3d..cf1de50 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "ges-structured-interface.h"
 
 #include <string.h>
index 9f2c5fb..77bd5f3 100644 (file)
@@ -28,6 +28,9 @@
  * You can use the ges_asset_request_simple API to create an Asset
  * capable of extracting GESTestClip-s
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-test-clip.h"
index 57f1f3a..72d8265 100644 (file)
@@ -25,6 +25,9 @@
  *
  * Renders text onto the next lower priority stream using textrender.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-text-overlay-clip.h"
index 1278a6d..98d90b8 100644 (file)
@@ -24,6 +24,9 @@
  * @short_description: render text onto another video stream in a GESLayer
  *
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index fffaf5a..4a1e352 100644 (file)
@@ -26,6 +26,9 @@
  * as priority. A GESTimelineElement can have a parent object which will be
  * responsible for controlling its timing properties.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-utils.h"
 #include "ges-timeline-element.h"
index 4394146..041c29b 100644 (file)
@@ -40,6 +40,9 @@
  * Note that any change you make in the timeline will not actually be taken
  * into account until you call the #ges_timeline_commit method.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-project.h"
index 4e012a1..f663a22 100644 (file)
@@ -26,6 +26,9 @@
  * Renders the given text in the specified font, at specified position, and
  * with the specified background pattern.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-title-clip.h"
index 82ddaa2..be4671e 100644 (file)
@@ -87,6 +87,9 @@
  * </tgroup>
  * </informaltable>
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index 9e54c40..d6ed7a2 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESTrackElementAsset
  * @short_description: A GESAsset subclass specialized in GESTrackElement extraction
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-track-element-asset.h"
 
index ffc77dc..2fc2c33 100644 (file)
  * its container, like the start position, the inpoint, the duration and the
  * priority.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "ges-internal.h"
 #include "ges-extractable.h"
 #include "ges-track-element.h"
index 534a7af..b23d47c 100644 (file)
@@ -27,6 +27,9 @@
  *
  * Contains the compatible TrackElement(s).
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track.h"
index acff2f3..8a64291 100644 (file)
@@ -36,6 +36,9 @@
  * that this value can be changed after creation and the GESExtractable.asset value
  * will be updated when needed.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index 0036564..65c07e6 100644 (file)
@@ -24,6 +24,9 @@
  * @short_description: base class for audio and video transitions
  *
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index b440d77..7a28515 100644 (file)
  * let you get information about the medias. Also, the tags found in the media file are
  * set as Metadatas of the Asser.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <errno.h>
 #include <gst/pbutils/pbutils.h>
 #include "ges.h"
index d4ae141..3f8f63c 100644 (file)
@@ -26,6 +26,9 @@
  * Represents all the output streams from a particular uri. It is assumed that
  * the URI points to a file of some type.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-uri-clip.h"
index bd330cb..adb0d0c 100644 (file)
@@ -23,6 +23,9 @@
  * @short_description: Convenience methods
  *
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <string.h>
 
index f73a8f1..4433d88 100644 (file)
@@ -77,6 +77,9 @@
  * </tgroup>
  * </informaltable>
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/pbutils/missing-plugins.h>
 
index baea99f..22e04d8 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESVideoTestSource
  * @short_description: produce solid colors and patterns
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-internal.h"
 #include "ges-track-element.h"
index 0bcf1df..90fdeda 100644 (file)
@@ -22,6 +22,9 @@
  * @title: GESVideoTrack
  * @short_description: A standard GESTrack for raw video
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "ges-video-track.h"
 #include "ges-smart-video-mixer.h"
index 58af634..6165735 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESVideoTransition
  * @short_description: implements video crossfade transition
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <ges/ges.h>
 #include "ges-internal.h"
index 7b72539..1939046 100644 (file)
@@ -23,6 +23,9 @@
  * @title: GESVideoUriSource
  * @short_description: outputs a single video stream from a given file
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <gst/pbutils/missing-plugins.h>
 
index 4fe7c65..d529212 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#undef VERSION
+#endif
 
 
 /* TODO Determine error codes numbers */
index d342191..ba89315 100644 (file)
@@ -160,7 +160,7 @@ libges = library('ges-1.0', ges_sources, parser,
     version : libversion,
     soversion : soversion,
     darwin_versions : osxversion,
-    c_args : [ges_c_args],
+    c_args : [ges_c_args] + ['-DBUILDING_GES'],
     include_directories : [configinc],
     install : true,
     dependencies : libges_deps)
index 80cf650..4dfc112 100644 (file)
@@ -29,6 +29,9 @@ glib_req = '>= 2.40.0'
 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
 
 cc = meson.get_compiler('c')
+
+cdata = configuration_data()
+
 # Ignore several spurious warnings for things gstreamer does very commonly
 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
@@ -47,16 +50,23 @@ if cc.has_link_argument('-Wl,-Bsymbolic-functions')
 endif
 
 # Symbol visibility
-if cc.has_argument('-fvisibility=hidden')
+if cc.get_id() == 'msvc'
+  export_define = '__declspec(dllexport) extern'
+elif cc.has_argument('-fvisibility=hidden')
   add_project_arguments('-fvisibility=hidden', language: 'c')
+  export_define = 'extern __attribute__ ((visibility ("default")))'
+else
+  export_define = 'extern'
 endif
 
+# Passing this through the command line would be too messy
+cdata.set('GST_API_EXPORT', export_define)
+
 # Disable strict aliasing
 if cc.has_argument('-fno-strict-aliasing')
   add_project_arguments('-fno-strict-aliasing', language: 'c')
 endif
 
-cdata = configuration_data()
 cdata.set('VERSION', '"@0@"'.format(gst_version))
 cdata.set('PACKAGE', '"gst-editing-services"')
 cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))