summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2024-03-17 18:58:59 +0100
committerGitHub <noreply@github.com>2024-03-17 18:58:59 +0100
commit9cebda59e818cdb89dc1e53ab5bb51b91b3dc3ff (patch)
tree7a2b571571f54179aa8b78b817213e307dc85f5d
parentMerge pull request #31831 from DaanDeMeyer/opensuse (diff)
parentmeson: test with c++26 too (diff)
downloadsystemd-9cebda59e818cdb89dc1e53ab5bb51b91b3dc3ff.tar.xz
systemd-9cebda59e818cdb89dc1e53ab5bb51b91b3dc3ff.zip
Merge pull request #31829 from keszybz/more-header-checks
Update c/c++ version checks and add test for -std=c++26
-rw-r--r--src/systemd/meson.build37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/systemd/meson.build b/src/systemd/meson.build
index d50edb413f..a91d7064bb 100644
--- a/src/systemd/meson.build
+++ b/src/systemd/meson.build
@@ -62,30 +62,29 @@ opts = [['c'],
['c', '-std=iso9899:1990'],
['c', '-std=iso9899:2011']]
-if cc.has_argument('-std=iso9899:2017')
- opts += [['c', '-std=iso9899:2017']]
-endif
-
-if cc.has_argument('-std=c2x')
- opts += [['c', '-std=c2x']]
-endif
+foreach opt : ['-std=iso9899:2017',
+ '-std=c23',
+ ]
+ if cc.has_argument(opt)
+ opts += [['c', opt]]
+ endif
+endforeach
if cxx_cmd != ''
opts += [['c++'],
['c++', '-std=c++98'],
['c++', '-std=c++11']]
- if cxx.has_argument('-std=c++14')
- opts += [['c++', '-std=c++14']]
- endif
- if cxx.has_argument('-std=c++17')
- opts += [['c++', '-std=c++17']]
- endif
- if cxx.has_argument('-std=c++20')
- opts += [['c++', '-std=c++20']]
- endif
- if cxx.has_argument('-std=c++23')
- opts += [['c++', '-std=c++23']]
- endif
+
+ foreach opt : ['-std=c++14',
+ '-std=c++17',
+ '-std=c++20',
+ '-std=c++23',
+ '-std=c++26',
+ ]
+ if cxx.has_argument(opt)
+ opts += [['c++', opt]]
+ endif
+ endforeach
endif
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]