diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index 5e8323ff930e..2be41833a141 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -1304,10 +1304,12 @@ INSTALL_TARGETS += %(prefix)s if path else target).replace('/', '_') have_objdir_files = False for f in files: + dest = mozpath.join(reltarget, path, + mozpath.basename(f.full_path)) if not isinstance(f, ObjDirPath): - dest = mozpath.join(reltarget, path, mozpath.basename(f)) install_manifest.add_symlink(f.full_path, dest) else: + install_manifest.add_optional_exists(dest) backend_file.write('%s_FILES += %s\n' % ( target_var, self._pretty_path(f, backend_file))) have_objdir_files = True diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py index b5d0490cd894..07643b5ffdf6 100644 --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -401,11 +401,15 @@ class TestRecursiveMakeBackend(BackendTester): # EXPORTS files should appear in the dist_include install manifest. m = InstallManifest(path=mozpath.join(env.topobjdir, '_build_manifests', 'install', 'dist_include')) - self.assertEqual(len(m), 4) + self.assertEqual(len(m), 8) self.assertIn('foo.h', m) self.assertIn('mozilla/mozilla1.h', m) self.assertIn('mozilla/dom/dom1.h', m) self.assertIn('gfx/gfx.h', m) + self.assertIn('bar.h', m) + self.assertIn('mozilla/mozilla2.h', m) + self.assertIn('mozilla/dom/dom2.h', m) + self.assertIn('mozilla/dom/dom3.h', m) # EXPORTS files that are also GENERATED_FILES should be handled as # INSTALL_TARGETS. backend_path = mozpath.join(env.topobjdir, 'backend.mk')