validate: cleanup the use of GST_VALIDATE_API on Windows

Export or import properly the method from GST_VALIDATE_API
with a proper config.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3429>
This commit is contained in:
Stéphane Cerveau 2022-11-17 16:09:51 +00:00 committed by GStreamer Marge Bot
parent 322739264f
commit 1ba066bda2
9 changed files with 43 additions and 9 deletions

View file

@ -1,4 +1,9 @@
/*** BEGIN file-header ***/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gst-validate-enum-types.h"
#include <gst/validate/validate.h>
#define C_ENUM(v) ((gint) v)

View file

@ -1,11 +1,13 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include "validate.h"
#include "gst-validate-utils.h"
#include "gst-validate-internal.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define EXTRA_CHECKS_WRONG_NUMBER_OF_INSTANCES g_quark_from_static_string ("extrachecks::wrong-number-of-instances")

View file

@ -22,13 +22,14 @@
* Boston, MA 02111-1307, USA.
*/
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include <stdlib.h>
#include "validate.h"
#include "gst-validate-internal.h"
#include "gst-validate-report.h"

View file

@ -18,6 +18,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "media-descriptor-parser.h"
#include <string.h>

View file

@ -18,6 +18,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/validate/validate.h>
#include "media-descriptor-writer.h"

View file

@ -19,6 +19,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include "media-descriptor.h"

View file

@ -58,14 +58,14 @@ gst_validate_enums = gnome.mkenums('gstvalidateenumtypes',
validate_deps = [gst_check_dep, gst_dep, gst_controller_dep, gstbase_dep,
gio_dep, gmodule_dep, gst_pbutils_dep, mathlib, json_dep]
gstvalidate = library('gstvalidate-1.0',
gstvalidate = library('gstvalidate-@0@'.format(apiversion),
sources: gstvalidate_sources + gst_validate_enums + runner_file,
version : libversion,
soversion : soversion,
darwin_versions : osxversion,
include_directories : [inc_dirs],
install: true,
c_args : [gst_c_args] + ['-D_GNU_SOURCE'],
c_args : [gst_c_args] + ['-D_GNU_SOURCE', '-DBUILDING_GST_VALIDATE'],
dependencies : validate_deps)
if not static_build
@ -73,7 +73,7 @@ if not static_build
sources: gst_validate_enums + runner_file,
include_directories : [inc_dirs],
install: true,
c_args : [gst_c_args] + ['-D__GST_VALIDATE_PLUGIN', '-D_GNU_SOURCE'],
c_args : [gst_c_args] + ['-D__GST_VALIDATE_PLUGIN', '-D_GNU_SOURCE', '-DBUILDING_GST_VALIDATE'],
install_dir : plugins_install_dir,
objects: gstvalidate.extract_objects(gstvalidate_sources),
dependencies : validate_deps)

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_VALIDATE_API
#define GST_VALIDATE_API GST_EXPORT
#ifdef BUILDING_GST_VALIDATE
#define GST_VALIDATE_API GST_API_EXPORT /* from config.h */
#else
#define GST_VALIDATE_API GST_API_IMPORT
#endif
#endif
#endif /* __GST_VALIDATE_PRELUDE_H__ */

View file

@ -16,6 +16,19 @@ if cc.has_header('unistd.h')
cdata.set('HAVE_UNISTD_H', 1)
endif
# Symbol visibility
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)
configure_file(output : 'config.h', configuration : cdata)
validate_plugins_install_dir = '@0@/gstreamer-1.0/validate'.format(get_option('libdir'))