Can have multiple source files with the same name in one target.

pull/15/head
Jussi Pakkanen 11 years ago
parent 645ab7fea8
commit 8e29f2b160
  1. 3
      backends.py
  2. 1
      test cases/common/54 same file name/d1/file.c
  3. 1
      test cases/common/54 same file name/d2/file.c
  4. 3
      test cases/common/54 same file name/meson.build
  5. 6
      test cases/common/54 same file name/prog.c

@ -878,7 +878,8 @@ class NinjaBackend(Backend):
src_filename = os.path.basename(src)
else:
src_filename = src
rel_obj = os.path.join(self.get_target_private_dir(target), os.path.basename(src_filename))
obj_basename = src_filename.replace('/', '_').replace('\\', '_')
rel_obj = os.path.join(self.get_target_private_dir(target), obj_basename)
rel_obj += '.' + self.environment.get_object_suffix()
dep_file = rel_obj + '.' + compiler.get_depfile_suffix()
if self.environment.coredata.use_pch:

@ -0,0 +1 @@
int func1() { return 42; }

@ -0,0 +1 @@
int func2() { return 42; }

@ -0,0 +1,3 @@
project('samefile', 'c')
test('basic', executable('prog', 'prog.c', 'd1/file.c', 'd2/file.c'))

@ -0,0 +1,6 @@
int func1();
int func2();
int main(int argc, char **argv) {
return func1() - func2();
}
Loading…
Cancel
Save