forked from pool/meson
47 lines
2.1 KiB
Diff
47 lines
2.1 KiB
Diff
--- a/mesonbuild/compilers/cpp.py
|
|
+++ b/mesonbuild/compilers/cpp.py
|
|
@@ -102,9 +102,13 @@ class GnuCPPCompiler(GnuCompiler, CPPCom
|
|
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
|
|
|
|
def get_options(self):
|
|
+ cpp_stds = ['c++98', 'c++03', 'c++11', 'gnu++03', 'gnu++11']
|
|
+ if version_compare(self.version, '>=5.0.0'):
|
|
+ c_stds += ['c++14', 'c++17', 'c++1z', 'gnu++14', 'gnu++17', 'gnu++1z']
|
|
+ else:
|
|
+ c_stds += ['c++1y', 'gnu++1y']
|
|
opts = {'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
|
|
- ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
|
|
- 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'],
|
|
+ ['none'] + cpp_stds,
|
|
'none'),
|
|
'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
|
|
'STL debug mode',
|
|
--- a/mesonbuild/minit.py
|
|
+++ b/mesonbuild/minit.py
|
|
@@ -124,7 +124,7 @@ int main(int argc, char **argv) {{
|
|
hello_c_meson_template = '''project('{project_name}', 'c',
|
|
version : '{version}',
|
|
default_options : ['warning_level=3',
|
|
- 'cpp_std=c++14'])
|
|
+ 'cpp_std=c++1y'])
|
|
|
|
exe = executable('{exe_name}', '{source_name}',
|
|
install : true)
|
|
@@ -219,7 +219,7 @@ int main(int argc, char **argv) {{
|
|
|
|
lib_cpp_meson_template = '''project('{project_name}', 'cpp',
|
|
version : '{version}',
|
|
- default_options : ['warning_level=3', 'cpp_std=c++14'])
|
|
+ default_options : ['warning_level=3', 'cpp_std=c++1y'])
|
|
|
|
# These arguments are only used to build the shared library
|
|
# not the executables that use the library.
|
|
--- "a/test cases/unit/16 prebuilt shared/patron.c"
|
|
+++ "b/test cases/unit/16 prebuilt shared/patron.c"
|
|
@@ -5,4 +5,5 @@ int main(int argc, char **argv) {
|
|
printf("You are standing outside the Great Library of Alexandria.\n");
|
|
printf("You decide to go inside.\n\n");
|
|
alexandria_visit();
|
|
+ return 0;
|
|
}
|