diff --git a/source/dub/dub.d b/source/dub/dub.d index 544805f..3c5c11c 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -773,6 +773,13 @@ if (existsFile(path ~ ".dub/build")) rmdirRecurse((path ~ ".dub/build").toNativeString()); if (existsFile(path ~ ".dub/obj")) rmdirRecurse((path ~ ".dub/obj").toNativeString()); + + auto p = Package.load(path); + if (p.getBuildSettings().targetType == TargetType.none) { + foreach (sp; p.subPackages.filter!(sp => !sp.path.empty)) { + cleanPackage(path ~ sp.path); + } + } } /// Fetches the package matching the dependency and places it in the specified location.