Skip to content
Snippets Groups Projects
Commit 9da2c426 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

Merge branch 'wip/smcv/build' into 'main'

Build system cleanup

See merge request !585
parents 52dd6f99 fd5cb201
No related branches found
No related tags found
1 merge request!585Build system cleanup
Showing
with 114 additions and 115 deletions
......@@ -21,51 +21,64 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
executable(
'steam-runtime-system-info',
'system-info.c',
c_args : srt_c_args,
dependencies : [gio_unix, glib, json_glib, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use the adjacent json-glib, ignoring LD_LIBRARY_PATH even if set
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
srt_bin = []
executable(
'steam-runtime-check-requirements',
'check-requirements.c',
c_args : srt_c_args,
dependencies : [glib, gobject, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use the adjacent GLib, ignoring LD_LIBRARY_PATH even if set
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
# Programs that only need glibc
libc_programs = [
'launcher-interface-0',
]
executable(
'steam-runtime-identify-library-abi',
'identify-library-abi.c',
c_args : srt_c_args,
dependencies : [glib, gio_unix, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use GLib from the adjacent libdir, ignoring LD_LIBRARY_PATH
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
foreach bin_name : libc_programs
srt_bin += executable(
'steam-runtime-' + bin_name,
bin_name + '.c',
c_args : srt_c_args,
install : true,
)
endforeach
executable(
'steam-runtime-input-monitor',
'input-monitor.c',
c_args : srt_c_args,
dependencies : [gio_unix, glib, gobject, json_glib, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use the adjacent json-glib, ignoring LD_LIBRARY_PATH even if set
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
# Programs that need GLib
glib_programs = [
'check-requirements',
'identify-library-abi',
'steam-remote',
'urlopen',
]
foreach bin_name : glib_programs
srt_bin += executable(
'steam-runtime-' + bin_name,
bin_name + '.c',
c_args : srt_c_args,
dependencies : [glib, gobject, gio_unix, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use the adjacent GLib, ignoring LD_LIBRARY_PATH even if set
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
endforeach
# Programs that need GLib and json-glib
json_programs = [
'input-monitor',
'system-info',
]
foreach bin_name : json_programs
srt_bin += executable(
'steam-runtime-' + bin_name,
bin_name + '.c',
c_args : srt_c_args,
dependencies : [glib, gobject, gio_unix, json_glib, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use the adjacent json-glib, ignoring LD_LIBRARY_PATH even if set
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
endforeach
executable(
# Slightly different: needs threads and pv_include_dirs
srt_bin += executable(
'steam-runtime-launch-client',
sources: [
'launch-client.c',
......@@ -84,14 +97,8 @@ executable(
install_rpath : bin_rpath,
)
executable(
'steam-runtime-launcher-interface-0',
'launcher-interface-0.c',
c_args : srt_c_args,
install : true,
)
executable(
# Slightly different: needs threads, codegen and flatpak-utils-base
srt_bin += executable(
'steam-runtime-launcher-service',
sources: [
'launcher-service.c',
......@@ -112,28 +119,6 @@ executable(
install_rpath : bin_rpath,
)
executable(
'steam-runtime-steam-remote',
'steam-remote.c',
c_args : srt_c_args,
dependencies : [glib, gio_unix, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use GLib from the adjacent libdir, ignoring LD_LIBRARY_PATH
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
executable(
'steam-runtime-urlopen',
'urlopen.c',
c_args : srt_c_args,
dependencies : [glib, gio_unix, libglnx_dep, libsteamrt_static_dep],
install : true,
# Use GLib from the adjacent libdir, ignoring LD_LIBRARY_PATH
build_rpath : bin_rpath,
install_rpath : bin_rpath,
)
sh_scripts = [
'launch-options',
]
......@@ -160,18 +145,16 @@ foreach script : libexec_scripts
endforeach
if build_man_pages
foreach bin_name : [
'check-requirements',
'identify-library-abi',
'input-monitor',
'launch-client',
'launch-options',
'launcher-interface-0',
'launcher-service',
'steam-remote',
'system-info',
'urlopen',
]
foreach bin_name : (
libc_programs
+ glib_programs
+ json_programs
+ sh_scripts
+ [
'launch-client',
'launcher-service',
]
)
custom_target(
'steam-runtime-' + bin_name + '.1',
build_by_default : true,
......@@ -191,4 +174,6 @@ if build_man_pages
endforeach
endif
test_depends += srt_bin
# vim:set sw=2 sts=2 et:
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-platform',
'../identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="haswell"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-platform',
'../identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="i386"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-platform',
'../identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="i486"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-platform',
'../identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="i586"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-lib',
'../../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib/' + multiarch + '"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib32"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="lib64"',],
......
......@@ -21,9 +21,10 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
srt_helpers = []
uninstalled_env_vars += {'SRT_HELPERS_PATH': meson.current_build_dir()}
executable(
srt_helpers += executable(
multiarch + '-true',
'true.c',
include_directories : project_include_dirs,
......@@ -33,7 +34,7 @@ executable(
# executable has no dependencies.
)
executable(
srt_helpers += executable(
multiarch + '-check-locale',
'check-locale.c',
include_directories : project_include_dirs,
......@@ -45,7 +46,7 @@ executable(
install_rpath : pkglibexec_rpath,
)
executable(
srt_helpers += executable(
multiarch + '-inspect-library',
sources : ['inspect-library.c', 'inspect-library-utils.c'],
dependencies : [libdl],
......@@ -56,7 +57,7 @@ executable(
# a game with no special linking would be able to load a library.
)
executable(
srt_helpers += executable(
multiarch + '-inspect-library-libelf',
sources : ['inspect-library-libelf.c', 'inspect-library-utils.c'],
dependencies : [libdl, libelf],
......@@ -68,7 +69,7 @@ executable(
install_rpath : pkglibexec_rpath,
)
executable(
srt_helpers += executable(
multiarch + '-check-va-api',
'check-va-api.c',
dependencies : [libva, libva_x11, xlib],
......@@ -79,7 +80,7 @@ executable(
# a game with no special linking would be able to use VA-API.
)
executable(
srt_helpers += executable(
multiarch + '-check-vdpau',
'check-vdpau.c',
dependencies : [xlib, vdpau],
......@@ -90,7 +91,7 @@ executable(
# a game with no special linking would be able to use VDPAU.
)
executable(
srt_helpers += executable(
multiarch + '-check-vulkan',
'check-vulkan.c',
dependencies : [glib, gio_unix, libglnx_dep, libsteamrt_static_dep, json_glib, vulkan, xcb],
......@@ -104,7 +105,7 @@ executable(
)
foreach shader : ['frag', 'vert']
custom_target(
srt_helpers += custom_target(
shader + '.spv',
build_by_default : true,
command : [
......@@ -125,7 +126,7 @@ foreach shader : ['frag', 'vert']
)
endforeach
executable(
srt_helpers += executable(
multiarch + '-check-gl',
'check-gl.c',
dependencies : [xlib, gl],
......@@ -137,7 +138,7 @@ executable(
)
)
executable(
srt_helpers += executable(
multiarch + '-wflinfo',
'wflinfo.c',
c_args : silence_wflinfo_warnings,
......@@ -150,7 +151,7 @@ executable(
install_rpath : pkglibexec_rpath,
)
executable(
srt_helpers += executable(
multiarch + '-check-xdg-portal',
'check-xdg-portal.c',
include_directories : project_include_dirs,
......@@ -163,7 +164,7 @@ executable(
install_rpath : pkglibexec_rpath,
)
executable(
srt_helpers += executable(
multiarch + '-is-x-server-xwayland',
'is-x-server-xwayland.c',
include_directories : project_include_dirs,
......@@ -172,7 +173,7 @@ executable(
install_dir : pkglibexecdir,
)
executable(
srt_helpers += executable(
multiarch + '-detect-lib',
'detect.c',
c_args : [
......@@ -185,7 +186,7 @@ executable(
install_dir : pkglibexecdir,
)
executable(
srt_helpers += executable(
multiarch + '-detect-platform',
'detect.c',
c_args : [
......@@ -229,7 +230,7 @@ endif
# We can inline one instance of identify-platform here. All the others
# must be in a subdirectory due to Meson limitations.
shared_module(
srt_helpers += shared_module(
'identify-platform',
'identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="' + expected_platform + '"',],
......@@ -255,7 +256,7 @@ if multiarch != ''
# libcapsule doesn't currently have a Meson build system, so instead
# of building it as a subproject, we build our own source file that
# #includes everything we need from it.
executable(
srt_helpers += executable(
multiarch + '-capsule-capture-libs',
'capture-libs.c',
c_args : [
......@@ -273,4 +274,6 @@ if multiarch != ''
)
endif
test_depends += srt_helpers
# vim:set sw=2 sts=2 et:
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-lib',
'../identify-lib.c',
c_args : ['-D_SRT_LIB_VALUE="' + multiarch + '"',],
......
# Copyright 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
shared_module(
srt_helpers += shared_module(
'identify-platform',
'../identify-platform.c',
c_args : ['-D_SRT_PLATFORM_VALUE="xeon_phi"',],
......
# Copyright 2021-2022 Collabora Ltd.
# SPDX-License-Identifier: MIT
libcurl_shims = []
foreach suffix : ['', '-gnutls']
# A mock implementation of libcurl that exists only to give
# libsteam-runtime-shim-libcurl.so.4 the desired dependency,
......@@ -69,7 +71,7 @@ foreach suffix : ['', '-gnutls']
#
# This is not how to do high-quality ABIs, but we're stuck with it
# for historical and cross-distro compatibility reasons.
custom_target(
libcurl_shims += custom_target(
'steam-runtime-shim-libcurl' + suffix,
output : 'libsteam-runtime-shim-libcurl@0@.so.4'.format(suffix),
input : [
......@@ -98,7 +100,7 @@ foreach suffix : ['', '-gnutls']
)
endforeach
executable(
libcurl_shims += executable(
'steam-runtime-libcurl-compat-setup',
'compat-setup.c',
c_args : srt_c_args,
......@@ -131,5 +133,7 @@ if get_option('installed_tests')
)
endif
test_depends += libcurl_shims
# Mock libraries and helper executables used for regression testing
subdir('test-fixtures')
......@@ -19,11 +19,12 @@ foreach suffix : ['', '-gnutls']
install : get_option('installed_tests'),
install_dir : tests_dir / 'libcurl-compat' / '3' / multiarch,
)
test_depends += mock_libcurl
# Test executable that calls curl_version@CURL_OPENSSL_3
# or curl_version@CURL_GNUTLS_3, emulating a game compiled
# against the real libcurl on scout (or a host OS with compatible ABI)
executable(
test_depends += executable(
multiarch + '-steamrt-print-libcurl3@0@-version'.format(suffix),
'../print-version.c',
link_with : mock_libcurl,
......
......@@ -19,11 +19,12 @@ foreach suffix : ['', '-gnutls']
install : get_option('installed_tests'),
install_dir : tests_dir / 'libcurl-compat' / '4' / multiarch,
)
test_depends += mock_libcurl
# Test executable that calls curl_version@CURL_OPENSSL_4
# or curl_version@CURL_GNUTLS_4, emulating a tool like valgrind
# compiled against system libcurl, e.g. on Arch Linux
executable(
test_depends += executable(
multiarch + '-steamrt-print-libcurl4@0@-version'.format(suffix),
'../print-version.c',
link_with : mock_libcurl,
......
......@@ -6,7 +6,7 @@ foreach suffix : ['', '-gnutls']
# CURL_GNUTLS_3 and CURL_OPENSSL_4 or CURL_GNUTLS_4 symbols, used
# during unit testing. No known distribution's libcurl actually
# does this.
shared_library(
test_depends += shared_library(
'curl' + suffix,
'mock-both-curl@0@.c'.format(suffix),
link_args : [
......
......@@ -18,4 +18,5 @@ foreach suffix : ['', '-gnutls']
install : get_option('installed_tests'),
install_dir : tests_dir / 'libcurl-compat' / 'incompatible' / multiarch,
)
test_depends += mock_libcurl
endforeach
......@@ -14,11 +14,12 @@ foreach suffix : ['', '-gnutls']
install : get_option('installed_tests'),
install_dir : tests_dir / 'libcurl-compat' / 'none' / multiarch,
)
test_depends += mock_libcurl
# Test executable that calls curl_version() with an unspecified
# version, emulating a legacy program compiled against a very old
# system libcurl
executable(
test_depends += executable(
multiarch + '-steamrt-print-libcurl@0@-version'.format(suffix),
'../print-version.c',
link_with : mock_libcurl,
......
......@@ -19,6 +19,7 @@ foreach suffix : ['', '-gnutls']
install : get_option('installed_tests'),
install_dir : tests_dir / 'libcurl-compat' / 'scout' / multiarch,
)
test_depends += mock_libcurl
endforeach
if get_option('installed_tests')
......
......@@ -392,6 +392,8 @@ if multiarch != ''
common_test_env_vars += {'SRT_TEST_MULTIARCH': multiarch}
endif
test_depends = []
subdir('steam-runtime-tools')
if multiarch != ''
......
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