Files
debugcc/meson.build
Marijn Suijten 4d332b2b43 meson: Use configuration_data() instead of piping variables through echo
Having a template file with replacement macros is a bit cleaner than
encoding the setup of the file in `meson.build` and piping that through
`echo` with caputred variables.

Unfortunately there appears to be no support for repetition, to e.g.
expand a list of platform names into the various uses (array with comma-
separation, or individual `extern struct` declarations, forcing us to
have some form of string expansion within `meson.build`).
2023-11-06 13:00:56 +01:00

60 lines
1.1 KiB
Meson

# SPDX-License-Identifier: BSD-3-Clause
project('debugcc',
'c',
license: ['BSD-3-Clause'],
meson_version : '>= 0.61.0', # for install_symlink
default_options: [
'buildtype=release',
]
)
platforms = [
'msm8936',
'msm8994',
'msm8996',
'msm8998',
'qcs404',
'sc8280xp',
'sdm845',
'sm6115',
'sm6125',
'sm6350',
'sm6375',
'sm8150',
'sm8250',
'sm8350',
'sm8450',
'sm8550',
]
debugcc_srcs = [
'debugcc.c',
]
platform_defs = []
platform_array = []
foreach p: platforms
debugcc_srcs += p + '.c'
platform_defs += 'extern struct debugcc_platform ' + p + '_debugcc;'
platform_array += '\t&' + p + '_debugcc,'
install_symlink(p + '-debugcc',
install_dir: get_option('bindir'),
pointing_to: 'debugcc')
endforeach
platforms = configuration_data()
platforms.set('PLATFORM_DEFS', '\n'.join(platform_defs))
platforms.set('PLATFORM_ARRAY', '\n'.join(platform_array))
debugcc_srcs += configure_file(
input: 'platforms.c.in',
output: 'platforms.c',
configuration: platforms)
executable('debugcc',
debugcc_srcs,
install: true)