Commit cafeaf73 authored by Emmanuele Bassi's avatar Emmanuele Bassi

build: Simplify the GResource handling

Move the XML file into the data/ directory, and remove the full path to
the various resources; this avoids builddir != srcdir issues.

The C code generation can remain in the src/ directory, as long as the
appropriate location for the resources is specified.
parent 71d88cfa
...@@ -76,6 +76,5 @@ data/pix/Makefile ...@@ -76,6 +76,5 @@ data/pix/Makefile
help/Makefile help/Makefile
po/Makefile.in po/Makefile.in
src/Makefile src/Makefile
src/gnome-nibbles.gresource.xml
]) ])
AC_OUTPUT AC_OUTPUT
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/nibbles/ui">
<file>nibbles.ui</file>
<file>nibbles.css</file>
<file>scoreboard.ui</file>
<file>player-score-box.ui</file>
<file>controls-grid.ui</file>
<file>preferences-dialog.ui</file>
</gresource>
<gresource prefix="/org/gnome/nibbles/gtk">
<file alias="menus.ui">nibbles-menus.ui</file>
</gresource>
</gresources>
...@@ -34,16 +34,17 @@ gnome_nibbles_VALAFLAGS = \ ...@@ -34,16 +34,17 @@ gnome_nibbles_VALAFLAGS = \
--pkg libgames-support-1.0 \ --pkg libgames-support-1.0 \
--pkg gee-0.8 \ --pkg gee-0.8 \
--target-glib=$(GLIB_REQUIRED) \ --target-glib=$(GLIB_REQUIRED) \
--gresources=$(builddir)/gnome-nibbles.gresource.xml --gresources=$(top_srcdir)/data/gnome-nibbles.gresource.xml
gnome_nibbles_LDADD = \ gnome_nibbles_LDADD = \
$(GNOME_NIBBLES_LIBS) $(GNOME_NIBBLES_LIBS)
gnome-nibbles-resources.c: gnome-nibbles.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies gnome-nibbles.gresource.xml) resources = $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir=$(top_srcdir)/data $(top_srcdir)/data/gnome-nibbles.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) --generate-source $<
gnome-nibbles-resources.c: $(top_srcdir)/data/gnome-nibbles.gresource.xml $(resources)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/data --generate-source $<
CLEANFILES = \ CLEANFILES = \
gnome-nibbles.gresource.xml \
gnome-nibbles-resources.c gnome-nibbles-resources.c
-include $(top_srcdir)/git.mk -include $(top_srcdir)/git.mk
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/nibbles/ui">
<file alias="nibbles.ui">@top_srcdir@/data/nibbles.ui</file>
<file alias="nibbles.css">@top_srcdir@/data/nibbles.css</file>
<file alias="scoreboard.ui">@top_srcdir@/data/scoreboard.ui</file>
<file alias="player-score-box.ui">@top_srcdir@/data/player-score-box.ui</file>
<file alias="controls-grid.ui">@top_srcdir@/data/controls-grid.ui</file>
<file alias="preferences-dialog.ui">@top_srcdir@/data/preferences-dialog.ui</file>
</gresource>
<gresource prefix="/org/gnome/nibbles/gtk">
<file alias="menus.ui">@top_srcdir@/data/nibbles-menus.ui</file>
</gresource>
</gresources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment