~kennylevinsen/seatd-devel

build: don't use cc.get_supported_arguments for defines v1 APPLIED

Simon Ser: 1
 build: don't use cc.get_supported_arguments for defines

 1 files changed, 12 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/seatd-devel/patches/25971/mbox | git am -3
Learn more about email & git

[PATCH] build: don't use cc.get_supported_arguments for defines Export this patch

If the compiler errors out on some -DXXX flag, then we're in
trouble. Avoid using cc.get_supported_arguments for defines we
require. Only use it for detecting support for warning flags.
---
 meson.build | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index d8fd25dfe645..206cde132868 100644
--- a/meson.build
+++ b/meson.build
@@ -25,6 +25,18 @@ endif
seatdpath = '@0@/@1@/seatd'.format(get_option('prefix'), get_option('bindir'))

cc = meson.get_compiler('c')

add_project_arguments(
	[
		'-D_XOPEN_SOURCE=700',
		'-D__BSD_VISIBLE',
		'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
		'-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath),
		'-DSEATD_INSTALLPATH="@0@"'.format(seatdpath),
	],
	language: 'c',
)

add_project_arguments(cc.get_supported_arguments(
	[
		'-Wundef',
@@ -40,11 +52,6 @@ add_project_arguments(cc.get_supported_arguments(
		'-Wno-unused-command-line-argument',
		'-Wvla',
		'-Wl,--exclude-libs=ALL',
		'-D_XOPEN_SOURCE=700',
		'-D__BSD_VISIBLE',
		'-DSEATD_VERSION="@0@"'.format(meson.project_version()),
		'-DSEATD_DEFAULTPATH="@0@"'.format(defaultpath),
		'-DSEATD_INSTALLPATH="@0@"'.format(seatdpath),
	]),
	language: 'c',
)

base-commit: 88529f08567fabf28432d17dd94b863ea61d554d
-- 
2.33.1
Applied, thanks!