mirror of
https://github.com/linux-msm/debugcc.git
synced 2026-02-25 13:12:32 -08:00
Merge pull request #30 from MarijnS95/meson-config-data
meson: Use `configuration_data()` instead of piping variables through `echo`
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -50,7 +50,7 @@ jobs:
|
||||
apt -y install --no-install-recommends meson build-essential
|
||||
|
||||
- name: Install cross-compilers
|
||||
if:${{ matrix.target }} != 'native'
|
||||
if: matrix.target != 'native'
|
||||
run: |
|
||||
apt -y install gcc-${{ matrix.target }}
|
||||
FAMILY=$(echo ${{ matrix.target }} | cut -d- -f 1)
|
||||
|
||||
17
meson.build
17
meson.build
@@ -33,7 +33,7 @@ debugcc_srcs = [
|
||||
]
|
||||
|
||||
platform_defs = []
|
||||
platform_array = ['const struct debugcc_platform *platforms[] = {']
|
||||
platform_array = []
|
||||
|
||||
foreach p: platforms
|
||||
debugcc_srcs += p + '.c'
|
||||
@@ -45,19 +45,14 @@ foreach p: platforms
|
||||
pointing_to: 'debugcc')
|
||||
endforeach
|
||||
|
||||
platform_array += '\tNULL,'
|
||||
platform_array += '};'
|
||||
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',
|
||||
capture: true,
|
||||
command: ['echo',
|
||||
'/* Autogenerated file, do not edit */\n\n' +
|
||||
'#include <stdlib.h>\n\n' +
|
||||
'\n'.join(platform_defs) +
|
||||
'\n\n' +
|
||||
'\n'.join(platform_array)
|
||||
])
|
||||
configuration: platforms)
|
||||
|
||||
executable('debugcc',
|
||||
debugcc_srcs,
|
||||
|
||||
9
platforms.c.in
Normal file
9
platforms.c.in
Normal file
@@ -0,0 +1,9 @@
|
||||
/* Autogenerated file, do not edit */
|
||||
#include <stdlib.h>
|
||||
|
||||
@PLATFORM_DEFS@
|
||||
|
||||
const struct debugcc_platform *platforms[] = {
|
||||
@PLATFORM_ARRAY@
|
||||
NULL,
|
||||
};
|
||||
Reference in New Issue
Block a user