mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
meson: use loops to unify repeated checks
This commit is contained in:
parent
c78e86ab8d
commit
62dfaa229e
|
@ -62,30 +62,28 @@ opts = [['c'],
|
||||||
['c', '-std=iso9899:1990'],
|
['c', '-std=iso9899:1990'],
|
||||||
['c', '-std=iso9899:2011']]
|
['c', '-std=iso9899:2011']]
|
||||||
|
|
||||||
if cc.has_argument('-std=iso9899:2017')
|
foreach opt : ['-std=iso9899:2017',
|
||||||
opts += [['c', '-std=iso9899:2017']]
|
'-std=c2x',
|
||||||
endif
|
]
|
||||||
|
if cc.has_argument(opt)
|
||||||
if cc.has_argument('-std=c2x')
|
opts += [['c', opt]]
|
||||||
opts += [['c', '-std=c2x']]
|
endif
|
||||||
endif
|
endforeach
|
||||||
|
|
||||||
if cxx_cmd != ''
|
if cxx_cmd != ''
|
||||||
opts += [['c++'],
|
opts += [['c++'],
|
||||||
['c++', '-std=c++98'],
|
['c++', '-std=c++98'],
|
||||||
['c++', '-std=c++11']]
|
['c++', '-std=c++11']]
|
||||||
if cxx.has_argument('-std=c++14')
|
|
||||||
opts += [['c++', '-std=c++14']]
|
foreach opt : ['-std=c++14',
|
||||||
endif
|
'-std=c++17',
|
||||||
if cxx.has_argument('-std=c++17')
|
'-std=c++20',
|
||||||
opts += [['c++', '-std=c++17']]
|
'-std=c++23',
|
||||||
endif
|
]
|
||||||
if cxx.has_argument('-std=c++20')
|
if cxx.has_argument(opt)
|
||||||
opts += [['c++', '-std=c++20']]
|
opts += [['c++', opt]]
|
||||||
endif
|
endif
|
||||||
if cxx.has_argument('-std=c++23')
|
endforeach
|
||||||
opts += [['c++', '-std=c++23']]
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
|
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]
|
||||||
|
|
Loading…
Reference in a new issue