Skip to content

Commit 1cce39b

Browse files
committed
meson: add global defines using add_project_arguments()
We're not going to be compiling any other C code, so let's simplify this.
1 parent 58be056 commit 1cce39b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ python_dep = python.dependency()
1515

1616
libsystemd_dep = dependency('libsystemd')
1717

18-
common_c_args = [
18+
add_project_arguments(
1919
'-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
2020
'-DLIBSYSTEMD_VERSION=@0@'.format(libsystemd_dep.version()),
21-
]
21+
language : 'c',
22+
)
2223

2324
subdir('src/systemd')

src/systemd/meson.build

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ python.extension_module(
55
'_journal',
66
['_journal.c', 'pyutil.c'],
77
dependencies: [libsystemd_dep],
8-
c_args: common_c_args,
98
install: true,
109
subdir: 'systemd',
1110
)
@@ -15,7 +14,6 @@ python.extension_module(
1514
'_reader',
1615
['_reader.c', 'pyutil.c', 'strv.c'],
1716
dependencies: [libsystemd_dep],
18-
c_args: common_c_args,
1917
install: true,
2018
subdir: 'systemd',
2119
)
@@ -25,7 +23,6 @@ python.extension_module(
2523
'_daemon',
2624
['_daemon.c', 'pyutil.c', 'util.c'],
2725
dependencies: [libsystemd_dep],
28-
c_args: common_c_args,
2926
install: true,
3027
subdir: 'systemd',
3128
)
@@ -35,7 +32,6 @@ python.extension_module(
3532
'id128',
3633
['id128.c', 'pyutil.c'],
3734
dependencies: [libsystemd_dep],
38-
c_args: common_c_args,
3935
install: true,
4036
subdir: 'systemd',
4137
)
@@ -45,7 +41,6 @@ python.extension_module(
4541
'login',
4642
['login.c', 'pyutil.c', 'strv.c'],
4743
dependencies: [libsystemd_dep],
48-
c_args: common_c_args,
4944
install: true,
5045
subdir: 'systemd',
5146
)

0 commit comments

Comments
 (0)