| Index: tools/gn/xcode_object.cc
|
| diff --git a/tools/gn/xcode_object.cc b/tools/gn/xcode_object.cc
|
| index dc5bfb86a7a942b60bf0956dc6df6be0d024ef87..7c0a45674db5cd1835d95aac285342d87ee55099 100644
|
| --- a/tools/gn/xcode_object.cc
|
| +++ b/tools/gn/xcode_object.cc
|
| @@ -365,8 +365,11 @@ void PBXAggregateTarget::Print(std::ostream& out, unsigned indent) const {
|
| // PBXBuildFile ---------------------------------------------------------------
|
|
|
| PBXBuildFile::PBXBuildFile(const PBXFileReference* file_reference,
|
| - const PBXSourcesBuildPhase* build_phase)
|
| - : file_reference_(file_reference), build_phase_(build_phase) {
|
| + const PBXSourcesBuildPhase* build_phase,
|
| + const HelpCompilerFlagEnabled help_flag_enabled)
|
| + : file_reference_(file_reference),
|
| + build_phase_(build_phase),
|
| + help_flag_enabled_(help_flag_enabled) {
|
| DCHECK(file_reference_);
|
| DCHECK(build_phase_);
|
| }
|
| @@ -387,6 +390,12 @@ void PBXBuildFile::Print(std::ostream& out, unsigned indent) const {
|
| out << indent_str << Reference() << " = {";
|
| PrintProperty(out, rules, "isa", ToString(Class()));
|
| PrintProperty(out, rules, "fileRef", file_reference_);
|
| + if (help_flag_enabled_ == HelpCompilerFlagEnabled::HELP_FLAG_ENABLED) {
|
| + std::map<std::string, std::string> settings = {
|
| + {"COMPILER_FLAGS", "--help"},
|
| + };
|
| + PrintProperty(out, rules, "settings", settings);
|
| + }
|
| out << "};\n";
|
| }
|
|
|
| @@ -560,10 +569,11 @@ PBXNativeTarget::PBXNativeTarget(const std::string& name,
|
| PBXNativeTarget::~PBXNativeTarget() {}
|
|
|
| void PBXNativeTarget::AddFileForIndexing(
|
| - const PBXFileReference* file_reference) {
|
| + const PBXFileReference* file_reference,
|
| + const PBXBuildFile::HelpCompilerFlagEnabled help_flag_enabled) {
|
| DCHECK(file_reference);
|
| - source_build_phase_->AddBuildFile(
|
| - base::MakeUnique<PBXBuildFile>(file_reference, source_build_phase_));
|
| + source_build_phase_->AddBuildFile(base::MakeUnique<PBXBuildFile>(
|
| + file_reference, source_build_phase_, help_flag_enabled));
|
| }
|
|
|
| PBXObjectClass PBXNativeTarget::Class() const {
|
| @@ -607,7 +617,9 @@ PBXProject::PBXProject(const std::string& name,
|
|
|
| PBXProject::~PBXProject() {}
|
|
|
| -void PBXProject::AddSourceFile(const std::string& source_path) {
|
| +void PBXProject::AddSourceFile(
|
| + const std::string& source_path,
|
| + const PBXBuildFile::HelpCompilerFlagEnabled help_flag_enabled) {
|
| PBXFileReference* file_reference = sources_->AddSourceFile(source_path);
|
| base::StringPiece ext = FindExtension(&source_path);
|
| if (!IsSourceFileForIndexing(ext))
|
| @@ -631,7 +643,7 @@ void PBXProject::AddSourceFile(const std::string& source_path) {
|
| }
|
|
|
| DCHECK(target_for_indexing_);
|
| - target_for_indexing_->AddFileForIndexing(file_reference);
|
| + target_for_indexing_->AddFileForIndexing(file_reference, help_flag_enabled);
|
| }
|
|
|
| void PBXProject::AddAggregateTarget(const std::string& name,
|
|
|