SHA256
3
0
forked from pool/meson
Alexei Sorokin 2018-03-21 22:53:28 +00:00 committed by Git OBS Bridge
parent b996db9e9e
commit ccb7495013
2 changed files with 10 additions and 14 deletions

View File

@ -4,15 +4,15 @@
'3': default_warn_args + ['-Wextra', '-Wpedantic']}
def get_options(self):
+ c_stds = ['c++98', 'c++03', 'c++11']
+ g_stds = ['gnu++03', 'gnu++11']
+ 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']
+ g_stds += ['gnu++14', 'gnu++17', 'gnu++1z']
+ 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'] + c_stds + g_stds,
+ ['none'] + cpp_stds,
'none'),
'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
'STL debug mode',
@ -23,7 +23,7 @@
version : '{version}',
default_options : ['warning_level=3',
- 'cpp_std=c++14'])
+ 'cpp_std=c++11'])
+ 'cpp_std=c++1y'])
exe = executable('{exe_name}', '{source_name}',
install : true)
@ -32,7 +32,7 @@
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++11'])
+ 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.

View File

@ -42,7 +42,7 @@
'relative path, it is assumed to be a subdir of prefix.'
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -935,6 +935,32 @@ def detect_subprojects(spdir_name, curre
@@ -935,6 +935,30 @@ def detect_subprojects(spdir_name, curre
result[basename] = [trial]
return result
@ -64,10 +64,8 @@
+ if c != p:
+ break
+ new.append(c)
+ # Don't convert '' into '.'
+ if not new:
+ common = ''
+ break
+ raise ValueError("Can't mix absolute and relative paths") from None
+ new = os.path.join(*new)
+ common = pathlib.PurePath(new)
+ return str(common)
@ -90,7 +88,7 @@
return 1
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -427,6 +427,26 @@ class InternalTests(unittest.TestCase):
@@ -427,6 +427,24 @@ class InternalTests(unittest.TestCase):
kwargs = {'sources': [1, 2, 3], 'pch_sources': [4, 5, 6]}
self.assertEqual([[1, 2, 3], [4, 5, 6]], extract(kwargs, 'sources', 'pch_sources'))
@ -108,8 +106,6 @@
+ self.assertEqual(commonpath(['/usr/./bin', '/usr/bin']), sep + 'usr' + sep + 'bin')
+ self.assertEqual(commonpath(['/usr/local', '/usr/lib']), sep + 'usr')
+ self.assertEqual(commonpath(['/usr', '/bin']), sep)
+ self.assertEqual(commonpath(['/usr', 'bin']), '')
+ self.assertEqual(commonpath(['blam', 'bin']), '')
+ prefix = '/some/path/to/prefix'
+ libdir = '/some/path/to/prefix/libdir'
+ self.assertEqual(commonpath([prefix, libdir]), str(PurePath(prefix)))