[gtk+] build: Improve vulkan resource handling
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] build: Improve vulkan resource handling
- Date: Tue, 5 Sep 2017 19:19:10 +0000 (UTC)
commit a55b57caffcac21dbce3bc544dac7e1906d108af
Author: Patrick Griffis <tingping tingping se>
Date: Tue Sep 5 12:47:10 2017 -0400
build: Improve vulkan resource handling
This fixes the proper dependencies getting set up for generating
the shaders and only the necessary things getting rebuilt on
resources changing in gsk.
gsk/meson.build | 8 +++++++-
gsk/resources/vulkan/meson.build | 8 ++------
2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gsk/meson.build b/gsk/meson.build
index 7725171..3c1278f 100644
--- a/gsk/meson.build
+++ b/gsk/meson.build
@@ -45,7 +45,12 @@ gsk_public_headers = files([
install_headers(gsk_public_headers, 'gsk.h', subdir: 'gtk-4.0/gsk')
gsk_private_vulkan_shaders = []
+# This is an odd split because we use configure_file() below to workaround
+# a limitation in meson preventing using custom_target() with gnome.compile_resources()
+# and that requires file paths, but we also need to have dependencies during development
+# on constantly regenerated files.
gsk_private_vulkan_compiled_shaders = []
+gsk_private_vulkan_compiled_shaders_deps = []
if have_vulkan
gsk_private_sources += files([
@@ -96,6 +101,7 @@ gskenum_h = gsk_enums[1]
gskresources = gnome.compile_resources('gskresources',
gsk_resources_xml,
+ dependencies: gsk_private_vulkan_compiled_shaders_deps,
source_dir: '.',
c_name: '_gsk',
extra_args: [ '--manual-register', ])
@@ -126,5 +132,5 @@ libgsk = static_library('gsk',
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgsk_dep = declare_dependency(include_directories: [ confinc, ],
- sources: [ gskenum_h, gskresources, ],
+ sources: [ gskenum_h, ],
dependencies: libgdk_dep)
diff --git a/gsk/resources/vulkan/meson.build b/gsk/resources/vulkan/meson.build
index bdca123..b18a298 100644
--- a/gsk/resources/vulkan/meson.build
+++ b/gsk/resources/vulkan/meson.build
@@ -45,7 +45,6 @@ foreach shader: gsk_private_vulkan_shaders
compiled_shader = custom_target(spv_shader,
input: shader,
output: spv_shader,
- build_by_default: true,
command: [
glslc,
stage_arg,
@@ -56,7 +55,6 @@ foreach shader: gsk_private_vulkan_shaders
compiled_clip_shader = custom_target(clip_spv_shader,
input: shader,
output: clip_spv_shader,
- build_by_default: true,
command: [
glslc,
stage_arg,
@@ -67,7 +65,6 @@ foreach shader: gsk_private_vulkan_shaders
compiled_clip_rounded_shader = custom_target(clip_rounded_spv_shader,
input: shader,
output: clip_rounded_spv_shader,
- build_by_default: true,
command: [
glslc,
stage_arg,
@@ -75,8 +72,7 @@ foreach shader: gsk_private_vulkan_shaders
'@INPUT@',
'-o', '@OUTPUT@'
])
+ gsk_private_vulkan_compiled_shaders_deps += [compiled_shader, compiled_clip_shader,
compiled_clip_rounded_shader]
endif
- gsk_private_vulkan_compiled_shaders += files(spv_shader)
- gsk_private_vulkan_compiled_shaders += files(clip_spv_shader)
- gsk_private_vulkan_compiled_shaders += files(clip_rounded_spv_shader)
+ gsk_private_vulkan_compiled_shaders += files(spv_shader, clip_spv_shader, clip_rounded_spv_shader)
endforeach
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]