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.
pull/413/head
Nicolas Schneider 9 years ago
parent 32b43e77ab
commit 6de2fd6ab5
  1. 6
      mesonbuild/backend/vs2010backend.py
  2. 6
      test cases/common/106 subproject subdir/meson.build
  3. 5
      test cases/common/106 subproject subdir/prog.c
  4. 2
      test cases/common/106 subproject subdir/subprojects/sub/lib/meson.build
  5. 5
      test cases/common/106 subproject subdir/subprojects/sub/lib/sub.c
  6. 6
      test cases/common/106 subproject subdir/subprojects/sub/lib/sub.h
  7. 2
      test cases/common/106 subproject subdir/subprojects/sub/meson.build

@ -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]

@ -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)

@ -0,0 +1,5 @@
#include <sub.h>
int main() {
return sub();
}

@ -0,0 +1,2 @@
lib = static_library('sub', 'sub.c')
libSub = declare_dependency(include_directories: include_directories('.'), link_with: lib)

@ -0,0 +1,5 @@
#include "sub.h"
int sub() {
return 0;
}

@ -0,0 +1,6 @@
#ifndef SUB_H
#define SUB_H
int sub();
#endif
Loading…
Cancel
Save