Skip to content
Snippets Groups Projects
Commit db80c00b authored by Simon McVittie's avatar Simon McVittie
Browse files

build: Use a loop to reduce repetition when compiling shaders

parent a0a3cfe7
No related branches found
No related tags found
1 merge request!104Use loops to reduce build-system repetition
...@@ -80,45 +80,27 @@ executable( ...@@ -80,45 +80,27 @@ executable(
# and its associated drivers successfully. # and its associated drivers successfully.
) )
custom_target( foreach shader : ['frag', 'vert']
'frag.spv', custom_target(
build_by_default : true, shader + '.spv',
command : [ build_by_default : true,
glslang_validator, command : [
'--target-env', 'vulkan1.0', glslang_validator,
'-o', '@OUTPUT@', '--target-env', 'vulkan1.0',
'@INPUT@', '-o', '@OUTPUT@',
], '@INPUT@',
input : 'shader.frag', ],
output : 'frag.spv', input : 'shader.' + shader,
install : true, output : shader + '.spv',
install_dir : join_paths( install : true,
get_option('prefix'), install_dir : join_paths(
get_option('libexecdir'), get_option('prefix'),
'steam-runtime-tools-' + api_major, get_option('libexecdir'),
'shaders', 'steam-runtime-tools-' + api_major,
) 'shaders',
) )
custom_target(
'vert.spv',
build_by_default : true,
command : [
glslang_validator,
'--target-env', 'vulkan1.0',
'-o', '@OUTPUT@',
'@INPUT@',
],
input : 'shader.vert',
output : 'vert.spv',
install : true,
install_dir : join_paths(
get_option('prefix'),
get_option('libexecdir'),
'steam-runtime-tools-' + api_major,
'shaders',
) )
) endforeach
executable( executable(
multiarch + '-check-gl', multiarch + '-check-gl',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment