From 5020a6e83a0db3879ea3dfb5a7d76e4612568c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Mon, 4 Apr 2022 10:12:20 +0200 Subject: [PATCH] gst-examples: add -xobjective-c for darwin To avoid error when including #include the build should include the c args xobjective-c Part-of: --- subprojects/gst-examples/meson.build | 2 ++ subprojects/gst-examples/playback/player/gtk/gtk-play.c | 2 +- subprojects/gst-examples/playback/player/gtk/meson.build | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-examples/meson.build b/subprojects/gst-examples/meson.build index 33e396a8a3..a924af923e 100644 --- a/subprojects/gst-examples/meson.build +++ b/subprojects/gst-examples/meson.build @@ -9,6 +9,8 @@ if cc.get_id() == 'msvc' language : 'c') endif +host_system = host_machine.system() + gst_version = meson.project_version() version_arr = gst_version.split('.') diff --git a/subprojects/gst-examples/playback/player/gtk/gtk-play.c b/subprojects/gst-examples/playback/player/gtk/gtk-play.c index c11b8a5af1..b38d50285f 100644 --- a/subprojects/gst-examples/playback/player/gtk/gtk-play.c +++ b/subprojects/gst-examples/playback/player/gtk/gtk-play.c @@ -196,7 +196,7 @@ video_area_realize_cb (GtkWidget * widget, GtkPlay * play) #if defined (GDK_WINDOWING_WIN32) window_handle = (guintptr) GDK_WINDOW_HWND (window); #elif defined (GDK_WINDOWING_QUARTZ) - window_handle = gdk_quartz_window_get_nsview (window); + window_handle = (guintptr) gdk_quartz_window_get_nsview (window); #elif defined (GDK_WINDOWING_X11) window_handle = GDK_WINDOW_XID (window); #endif diff --git a/subprojects/gst-examples/playback/player/gtk/meson.build b/subprojects/gst-examples/playback/player/gtk/meson.build index 03840bac22..a3bd83e530 100644 --- a/subprojects/gst-examples/playback/player/gtk/meson.build +++ b/subprojects/gst-examples/playback/player/gtk/meson.build @@ -1,6 +1,12 @@ gtk_dep = dependency('gtk+-3.0', required: false) x11_dep = dependency('x11', required: false) +if host_system == 'darwin' + extra_c_args = ['-xobjective-c'] +else + extra_c_args = [] +endif + if gtk_dep.found() gnome = import('gnome') @@ -13,5 +19,6 @@ if gtk_dep.found() gtk_play_resources, 'gtk-video-renderer.h', 'gtk-video-renderer.c'], + c_args : extra_c_args, dependencies : [gst_dep, gsttag_dep, gstplay_dep, gtk_dep, x11_dep]) endif