Merge pull request #31829 from keszybz/more-header-checks

Update c/c++ version checks and add test for -std=c++26
This commit is contained in:
Luca Boccassi 2024-03-17 17:58:59 +00:00 committed by GitHub
commit 9cebda59e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,30 +62,29 @@ 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=c23',
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 '-std=c++26',
if cxx.has_argument('-std=c++20') ]
opts += [['c++', '-std=c++20']] if cxx.has_argument(opt)
endif opts += [['c++', opt]]
if cxx.has_argument('-std=c++23') endif
opts += [['c++', '-std=c++23']] endforeach
endif
endif endif
foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path] foreach header : _systemd_headers + _not_installed_headers + [libudev_h_path]