Success &= ParseAnalyzerArgs(*Res.getAnalyzerOpts(), Args, Diags);
Success &= ParseMigratorArgs(Res.getMigratorOpts(), Args);
ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), Args);
+ if (!Res.getDependencyOutputOpts().OutputFile.empty() &&
+ Res.getDependencyOutputOpts().Targets.empty()) {
+ Diags.Report(diag::err_fe_dependency_file_requires_MT);
+ Success = false;
+ }
Success &=
ParseDiagnosticArgs(Res.getDiagnosticOpts(), Args, &Diags,
false /*DefaultDiagColor*/, false /*DefaultShowOpt*/);
}
void DependencyFileGenerator::attachToPreprocessor(Preprocessor &PP) {
- if (Targets.empty()) {
- PP.getDiagnostics().Report(diag::err_fe_dependency_file_requires_MT);
- return;
- }
-
// Disable the "file not found" diagnostic if the -MG option was given.
if (AddMissingHeaderDeps)
PP.SetSuppressIncludeNotFoundError(true);