From 95788c9834e81f4bbb4aa9a52900d395572b7f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 10 Aug 2018 13:56:07 +0200 Subject: [PATCH] build: Use dedicated resources for helper programs Using a single resource file for all JS sources saves a couple of build system instructions, but has some serious downsides: - bundling the entire shell code with the tools blows up their size unnecessarily - the tools are rebuilt unnecessarily for any shell code change Autotools was painful enough to let this slip, but with meson we don't have any excuses - using the actual dependencies speeds up the build a tiny bit and reduces the tools' sizes from over 2M to about 50k. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/192 --- js/js-resources.gresource.xml | 4 ---- js/meson.build | 14 ++++++++++++++ js/portal-resources.gresource.xml | 7 +++++++ js/prefs-resources.gresource.xml | 11 +++++++++++ src/meson.build | 4 ++-- 5 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 js/portal-resources.gresource.xml create mode 100644 js/prefs-resources.gresource.xml diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml index 3c0feab60..75a6c3b12 100644 --- a/js/js-resources.gresource.xml +++ b/js/js-resources.gresource.xml @@ -9,8 +9,6 @@ gdm/realmd.js gdm/util.js - extensionPrefs/main.js - misc/config.js misc/extensionUtils.js misc/fileUtils.js @@ -33,8 +31,6 @@ perf/core.js perf/hwtest.js - portalHelper/main.js - ui/accessDialog.js ui/altTab.js ui/animation.js diff --git a/js/meson.build b/js/meson.build index dd8ca3f66..4a572c53f 100644 --- a/js/meson.build +++ b/js/meson.build @@ -6,3 +6,17 @@ js_resources = gnome.compile_resources( c_name: 'shell_js_resources', dependencies: [config_js] ) + +portal_resources = gnome.compile_resources( + 'portal-resources', 'portal-resources.gresource.xml', + source_dir: ['.', meson.current_build_dir()], + c_name: 'portal_js_resources', + dependencies: [config_js] +) + +prefs_resources = gnome.compile_resources( + 'prefs-resources', 'prefs-resources.gresource.xml', + source_dir: ['.', meson.current_build_dir()], + c_name: 'prefs_js_resources', + dependencies: [config_js] +) diff --git a/js/portal-resources.gresource.xml b/js/portal-resources.gresource.xml new file mode 100644 index 000000000..3a06747b0 --- /dev/null +++ b/js/portal-resources.gresource.xml @@ -0,0 +1,7 @@ + + + + misc/config.js + portalHelper/main.js + + diff --git a/js/prefs-resources.gresource.xml b/js/prefs-resources.gresource.xml new file mode 100644 index 000000000..653c4cb3f --- /dev/null +++ b/js/prefs-resources.gresource.xml @@ -0,0 +1,11 @@ + + + + extensionPrefs/main.js + + misc/config.js + misc/extensionUtils.js + misc/fileUtils.js + misc/params.js + + diff --git a/src/meson.build b/src/meson.build index 8cd7fe8cf..178e05899 100644 --- a/src/meson.build +++ b/src/meson.build @@ -261,7 +261,7 @@ executable('gnome-shell', 'main.c', ) executable('gnome-shell-extension-prefs', - 'gnome-shell-extension-prefs.c', js_resources, + 'gnome-shell-extension-prefs.c', prefs_resources, c_args: tools_cflags, dependencies: tools_deps, include_directories: [conf_inc], @@ -271,7 +271,7 @@ executable('gnome-shell-extension-prefs', if have_networkmanager executable('gnome-shell-portal-helper', - 'gnome-shell-portal-helper.c', js_resources, + 'gnome-shell-portal-helper.c', portal_resources, c_args: tools_cflags, dependencies: tools_deps, include_directories: [conf_inc],