st: Fix generated GLSL dependency

StScrollViewFade depends on st-scroll-view-fade-generated.c, but
that dependency isn't expressed to the build system; we just hope
that the custom target runs before compiling the effect.

Instead, add the generated source to the st target so the dependency
is expressed properly.

(The change from .c to .h is to prevent the file from being both
included and compiled, resulting in a duplicated symbol)

https://bugzilla.gnome.org/show_bug.cgi?id=789937
This commit is contained in:
Florian Müllner 2019-12-20 20:54:07 +01:00
parent 3c87ad5aab
commit 15d74c9cd4
2 changed files with 6 additions and 5 deletions

View File

@ -155,14 +155,15 @@ st_gir_sources = st_sources + st_headers + st_enums
data_to_c = find_program(meson.source_root() + '/src/data-to-c.pl')
custom_target('scroll-view-fade-glsl',
glsl_sources = custom_target('scroll-view-fade-glsl',
input: ['st-scroll-view-fade.glsl'],
output: ['st-scroll-view-fade-generated.c'],
build_by_default: true,
output: ['st-scroll-view-fade-generated.h'],
capture: true,
command: [data_to_c, '@INPUT@', 'st_scroll_view_fade_glsl']
)
st_nogir_sources = [glsl_sources]
st_cflags = [
'-I@0@/src'.format(meson.source_root()),
'-I@0@'.format(meson.build_root()),
@ -177,7 +178,7 @@ st_cflags = [
# Currently meson requires a shared library for building girs
libst = shared_library('st-1.0',
sources: st_gir_sources + croco_sources,
sources: st_gir_sources + st_nogir_sources + croco_sources,
c_args: st_cflags,
dependencies: [clutter_dep, gtk_dep, mutter_dep, libxml_dep, m_dep],
build_rpath: mutter_typelibdir,

View File

@ -32,7 +32,7 @@
#define DEFAULT_FADE_OFFSET 68.0f
#include "st-scroll-view-fade-generated.c"
#include "st-scroll-view-fade-generated.h"
struct _StScrollViewFade
{