diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2016-02-24 00:40:14 +0100 |
---|---|---|
committer | Nicolas Schneider <nioncode+git@gmail.com> | 2016-02-24 00:40:14 +0100 |
commit | 6de2fd6ab5ce5301e840563d2898a82e18543bf0 (patch) | |
tree | caa7758bbf7fbb0c9db39fb6dc318265ca919036 | |
parent | 32b43e77abed69851c10577946068a0c029be908 (diff) | |
download | meson-6de2fd6ab5ce5301e840563d2898a82e18543bf0.zip meson-6de2fd6ab5ce5301e840563d2898a82e18543bf0.tar.gz meson-6de2fd6ab5ce5301e840563d2898a82e18543bf0.tar.bz2 |
vs2010: fix target_to_build_root method
Python's os.path.split() does not split the path into its components.
Instead, split the path with str.split() using the OS's file system
separator.
7 files changed, 28 insertions, 4 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index c9fe09f..a9567f4 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -217,10 +217,8 @@ class Vs2010Backend(backends.Backend): if target.subdir == '': return '' - directories = os.path.split(target.subdir) - directories = list(filter(bool,directories)) #Filter out empty strings - - return '/'.join(['..']*len(directories)) + directories = target.subdir.split(os.sep) + return os.sep.join(['..']*len(directories)) def special_quote(self, arr): return ['"%s"' % i for i in arr] diff --git a/test cases/common/106 subproject subdir/meson.build b/test cases/common/106 subproject subdir/meson.build new file mode 100644 index 0000000..ec9fad1 --- /dev/null +++ b/test cases/common/106 subproject subdir/meson.build @@ -0,0 +1,6 @@ +project('proj', 'c') +subproject('sub') +libSub = dependency('sub', fallback: ['sub', 'libSub']) + +exe = executable('prog', 'prog.c', dependencies: libSub) +test('subproject subdir', exe) diff --git a/test cases/common/106 subproject subdir/prog.c b/test cases/common/106 subproject subdir/prog.c new file mode 100644 index 0000000..02ae337 --- /dev/null +++ b/test cases/common/106 subproject subdir/prog.c @@ -0,0 +1,5 @@ +#include <sub.h> + +int main() { + return sub(); +} diff --git a/test cases/common/106 subproject subdir/subprojects/sub/lib/meson.build b/test cases/common/106 subproject subdir/subprojects/sub/lib/meson.build new file mode 100644 index 0000000..731d22b --- /dev/null +++ b/test cases/common/106 subproject subdir/subprojects/sub/lib/meson.build @@ -0,0 +1,2 @@ +lib = static_library('sub', 'sub.c') +libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib) diff --git a/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.c b/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.c new file mode 100644 index 0000000..3291e3c --- /dev/null +++ b/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.c @@ -0,0 +1,5 @@ +#include "sub.h" + +int sub() { + return 0; +} diff --git a/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.h b/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.h new file mode 100644 index 0000000..f1ab0e1 --- /dev/null +++ b/test cases/common/106 subproject subdir/subprojects/sub/lib/sub.h @@ -0,0 +1,6 @@ +#ifndef SUB_H +#define SUB_H + +int sub(); + +#endif diff --git a/test cases/common/106 subproject subdir/subprojects/sub/meson.build b/test cases/common/106 subproject subdir/subprojects/sub/meson.build new file mode 100644 index 0000000..bf69c25 --- /dev/null +++ b/test cases/common/106 subproject subdir/subprojects/sub/meson.build @@ -0,0 +1,2 @@ +project('sub', 'c') +subdir('lib') |