Skip to content
Snippets Groups Projects
Commit acf0cb6c authored by Ludovico de Nittis's avatar Ludovico de Nittis :palm_tree:
Browse files

build: Use configuration_data instead of manual compiler flags


Meson's `configuration_data()` allows us to generate a configuration
file instead of manually passing each options as compiler flags.

With this commit we align steam-runtime-tools with pressure-vessel that
already used a `config.h.in` file.

Signed-off-by: default avatarLudovico de Nittis <ludovico.denittis@collabora.com>
parent 9d13f240
No related branches found
No related tags found
1 merge request!243build: Use configuration_data instead of manual compiler flags
Checking pipeline status
#define G_LOG_DOMAIN "@project_name@"
#define _SRT_SONAME "libsteam-runtime-tools-@api_major@.so.@abi_major"
#define _SRT_MULTIARCH "@multiarch@"
#define _SRT_API_MAJOR "@api_major@"
...@@ -93,6 +93,20 @@ install_headers( ...@@ -93,6 +93,20 @@ install_headers(
subdir : join_paths('steam-runtime-tools-' + api_major, 'steam-runtime-tools'), subdir : join_paths('steam-runtime-tools-' + api_major, 'steam-runtime-tools'),
) )
conf_data = configuration_data()
conf_data.set('project_name', meson.project_name())
conf_data.set('api_major', api_major)
conf_data.set('abi_major', abi_major)
conf_data.set('multiarch', multiarch)
configure_file(
input : 'config.h.in',
output : '_srt-config.h',
configuration : conf_data,
)
srt_c_args = ['-include', '_srt-config.h']
libsteamrt_generated_headers_dep = declare_dependency( libsteamrt_generated_headers_dep = declare_dependency(
include_directories : project_include_dirs, include_directories : project_include_dirs,
sources : [enums[1]], sources : [enums[1]],
...@@ -100,12 +114,7 @@ libsteamrt_generated_headers_dep = declare_dependency( ...@@ -100,12 +114,7 @@ libsteamrt_generated_headers_dep = declare_dependency(
libsteamrt_static = static_library( libsteamrt_static = static_library(
'steam-runtime-tools-internal', 'steam-runtime-tools-internal',
libsteamrt_sources + libsteamrt_public_headers + enums, libsteamrt_sources + libsteamrt_public_headers + enums,
c_args : [ c_args : srt_c_args,
'-DG_LOG_DOMAIN="' + meson.project_name() + '"',
'-D_SRT_SONAME="libsteam-runtime-tools-' + api_major + '.so.' + abi_major + '"',
'-D_SRT_MULTIARCH="' + multiarch + '"',
'-D_SRT_API_MAJOR="' + api_major + '"',
],
include_directories : project_include_dirs, include_directories : project_include_dirs,
dependencies : [ dependencies : [
libdl, libdl,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment