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

This commit is contained in:
Jussi Pakkanen 2014-02-24 22:00:37 +02:00
parent 645ab7fea8
commit 8e29f2b160
5 changed files with 13 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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