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

Merge branch 'wip/smcv/build-with-loops' into 'master'

Use loops to reduce build-system repetition

See merge request steam/steam-runtime-tools!104
parents a0a3cfe7 033126af
No related branches found
Tags v0.20191120.0
1 merge request!104Use loops to reduce build-system repetition
Pipeline #2550 passed
......@@ -80,45 +80,27 @@ executable(
# and its associated drivers successfully.
)
custom_target(
'frag.spv',
build_by_default : true,
command : [
glslang_validator,
'--target-env', 'vulkan1.0',
'-o', '@OUTPUT@',
'@INPUT@',
],
input : 'shader.frag',
output : 'frag.spv',
install : true,
install_dir : join_paths(
get_option('prefix'),
get_option('libexecdir'),
'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',
foreach shader : ['frag', 'vert']
custom_target(
shader + '.spv',
build_by_default : true,
command : [
glslang_validator,
'--target-env', 'vulkan1.0',
'-o', '@OUTPUT@',
'@INPUT@',
],
input : 'shader.' + shader,
output : shader + '.spv',
install : true,
install_dir : join_paths(
get_option('prefix'),
get_option('libexecdir'),
'steam-runtime-tools-' + api_major,
'shaders',
)
)
)
endforeach
executable(
multiarch + '-check-gl',
......
......@@ -67,13 +67,21 @@ src = meson.current_source_dir() + '/' + 'sysroots'
# Note that the `-a` option is Linux specific
meson.add_install_script('sh', '-c', 'cp -a "$1" "${DESTDIR}/${MESON_INSTALL_PREFIX}/$2"', 'sh', src, tests_dir)
executable(
# These are all the same: they just exit 0.
foreach helper : [
'mock-good-check-gl',
'mock-good-check-vulkan',
'mock-software-check-gl',
'mock-true',
join_paths('..', 'helpers', 'true.c'),
include_directories : project_include_dirs,
install : get_option('installed_tests'),
install_dir : tests_dir,
)
]
executable(
helper,
join_paths('..', 'helpers', 'true.c'),
include_directories : project_include_dirs,
install : get_option('installed_tests'),
install_dir : tests_dir,
)
endforeach
executable(
'adverb',
......@@ -159,78 +167,30 @@ executable(
install_dir : tests_dir
)
executable(
# Helpers with no dependencies and one source file of the same name
# as the helper itself.
foreach helper : [
'mock-bad-check-vulkan',
'mock-bad-vulkaninfo',
'mock-bad-wflinfo',
'mock-good-vulkaninfo',
'mock-good-wflinfo',
'mock-good-wflinfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-hanging-wflinfo',
'mock-hanging-wflinfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-bad-wflinfo',
'mock-bad-wflinfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-sigusr-wflinfo',
'mock-software-wflinfo',
'mock-software-wflinfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-software-check-gl',
join_paths('..', 'helpers', 'true.c'),
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-good-vulkaninfo',
'mock-good-vulkaninfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-bad-vulkaninfo',
'mock-bad-vulkaninfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-good-check-vulkan',
join_paths('..', 'helpers', 'true.c'),
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-bad-check-vulkan',
'mock-bad-check-vulkan.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
]
executable(
helper,
helper + '.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
endforeach
# These need to be the same as their -good- counterparts, to exercise
# the case where the preliminary check succeeds, but actually rendering
# a window fails (hence "mixed").
executable(
'mock-mixed-vulkaninfo',
'mock-good-vulkaninfo.c',
......@@ -238,31 +198,6 @@ executable(
install: true,
install_dir: tests_dir
)
executable(
'mock-mixed-check-vulkan',
'mock-bad-check-vulkan.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-good-check-gl',
join_paths('..', 'helpers', 'true.c'),
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-bad-check-gl',
'mock-bad-check-vulkan.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-mixed-wflinfo',
'mock-good-wflinfo.c',
......@@ -271,65 +206,39 @@ executable(
install_dir: tests_dir
)
executable(
# These are all essentially the same as mock-bad-check-vulkan: they
# fail with a message on stderr.
foreach helper : [
'mock-bad-check-gl',
'mock-mixed-check-vulkan',
'mock-mixed-check-gl',
'mock-bad-check-vulkan.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-sigusr-wflinfo',
'mock-sigusr-wflinfo.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
]
executable(
helper,
'mock-bad-check-vulkan.c',
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
endforeach
executable(
# Helpers with a GLib dependency and one source file of the same name
# as the helper itself.
foreach helper : [
'mock-debian-x86_64-inspect-library',
'mock-debian-x86_64-inspect-library.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-debian-i386-inspect-library',
'mock-debian-i386-inspect-library.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-fedora-64-bit-inspect-library',
'mock-fedora-64-bit-inspect-library.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-fedora-32-bit-inspect-library',
'mock-fedora-32-bit-inspect-library.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
executable(
'mock-abi-inspect-library',
'mock-abi-inspect-library.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
]
executable(
helper,
helper + '.c',
dependencies : [glib],
include_directories : project_include_dirs,
install: true,
install_dir: tests_dir
)
endforeach
# vim:set sw=2 sts=2 et:
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