aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/wrap/wrap.py7
-rw-r--r--test cases/common/234 wrap case/meson.build6
-rw-r--r--test cases/common/234 wrap case/prog.c9
-rw-r--r--test cases/common/234 wrap case/subprojects/up_down.wrap5
-rw-r--r--test cases/common/234 wrap case/subprojects/up_down/meson.build3
-rw-r--r--test cases/common/234 wrap case/subprojects/up_down/up_down.h3
6 files changed, 31 insertions, 2 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index 6d2b91a..bb153c5 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -116,8 +116,8 @@ class PackageDefinition:
try:
self.config = configparser.ConfigParser(interpolation=None)
self.config.read(self.filename)
- except configparser.Error:
- raise WrapException('Failed to parse {}'.format(self.basename))
+ except configparser.Error as e:
+ raise WrapException('Failed to parse {}: {}'.format(self.basename, str(e)))
self.parse_wrap_section()
if self.type == 'redirect':
# [wrap-redirect] have a `filename` value pointing to the real wrap
@@ -251,6 +251,9 @@ class Resolver:
self.provided_programs.setdefault(k, v)
def find_dep_provider(self, packagename: str) -> T.Optional[T.Union[str, T.List[str]]]:
+ # Python's ini parser converts all key values to lowercase.
+ # Thus the query name must also be in lower case.
+ packagename = packagename.lower()
# Return value is in the same format as fallback kwarg:
# ['subproject_name', 'variable_name'], or 'subproject_name'.
wrap = self.provided_deps.get(packagename)
diff --git a/test cases/common/234 wrap case/meson.build b/test cases/common/234 wrap case/meson.build
new file mode 100644
index 0000000..2b82bf3
--- /dev/null
+++ b/test cases/common/234 wrap case/meson.build
@@ -0,0 +1,6 @@
+project('CaSe DePenDenCy In Wrap', 'c')
+
+d = dependency('UP_down')
+
+e = executable('prog', 'prog.c', dependencies: d)
+test('prog', e)
diff --git a/test cases/common/234 wrap case/prog.c b/test cases/common/234 wrap case/prog.c
new file mode 100644
index 0000000..41dfb81
--- /dev/null
+++ b/test cases/common/234 wrap case/prog.c
@@ -0,0 +1,9 @@
+#include<up_down.h>
+
+int main() {
+#ifdef UP_IS_DOWN
+ return 0;
+#else
+ return 1;
+#endif
+} \ No newline at end of file
diff --git a/test cases/common/234 wrap case/subprojects/up_down.wrap b/test cases/common/234 wrap case/subprojects/up_down.wrap
new file mode 100644
index 0000000..d66818f
--- /dev/null
+++ b/test cases/common/234 wrap case/subprojects/up_down.wrap
@@ -0,0 +1,5 @@
+[wrap-file]
+directory = up_down
+
+[provide]
+UP_down = up_down_dep
diff --git a/test cases/common/234 wrap case/subprojects/up_down/meson.build b/test cases/common/234 wrap case/subprojects/up_down/meson.build
new file mode 100644
index 0000000..5db89d1
--- /dev/null
+++ b/test cases/common/234 wrap case/subprojects/up_down/meson.build
@@ -0,0 +1,3 @@
+project('up down', 'c')
+
+up_down_dep = declare_dependency(include_directories: '.')
diff --git a/test cases/common/234 wrap case/subprojects/up_down/up_down.h b/test cases/common/234 wrap case/subprojects/up_down/up_down.h
new file mode 100644
index 0000000..8d968ce
--- /dev/null
+++ b/test cases/common/234 wrap case/subprojects/up_down/up_down.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#define UP_IS_DOWN