diff --git a/source/dub/project.d b/source/dub/project.d index bba506a..1ef1610 100644 --- a/source/dub/project.d +++ b/source/dub/project.d @@ -389,8 +389,8 @@ processVars(dst, pkg_path, psettings); if (psettings.importPaths.empty) logWarn(`Package %s (configuration "%s") defines no import paths, use {"importPaths": [...]} or the default package directory structure to fix this.`, pkg.name, configs[pkg.name]); - if (psettings.mainSourceFile.empty && pkg is m_main) - logWarn(`Package %s (configuration "%s") defines no main source file, this may cause certain build modes to fail. Add an explicit "mainSourceFile" to the package description to fix this.`, pkg.name, configs[pkg.name]); + if (psettings.mainSourceFile.empty && pkg is m_main && psettings.targetType == TargetType.executable) + logWarn(`Executable configuration "%s" of package %s defines no main source file, this may cause certain build modes to fail. Add an explicit "mainSourceFile" to the package description to fix this.`, configs[pkg.name], pkg.name); } if (pkg is m_main) { if (!shallow) {