| Index: tools/gn/xcode_object.cc
|
| diff --git a/tools/gn/xcode_object.cc b/tools/gn/xcode_object.cc
|
| index dc5bfb86a7a942b60bf0956dc6df6be0d024ef87..64c998cf45f74bdf55e23570b7c08977836547b4 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 CompilerFlags compiler_flag)
|
| + : file_reference_(file_reference),
|
| + build_phase_(build_phase),
|
| + compiler_flag_(compiler_flag) {
|
| 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 (compiler_flag_ == CompilerFlags::HELP) {
|
| + std::map<std::string, std::string> settings = {
|
| + {"COMPILER_FLAGS", "--help"},
|
| + };
|
| + PrintProperty(out, rules, "settings", settings);
|
| + }
|
| out << "};\n";
|
| }
|
|
|
| @@ -559,11 +568,11 @@ PBXNativeTarget::PBXNativeTarget(const std::string& name,
|
|
|
| PBXNativeTarget::~PBXNativeTarget() {}
|
|
|
| -void PBXNativeTarget::AddFileForIndexing(
|
| - const PBXFileReference* file_reference) {
|
| +void PBXNativeTarget::AddFileForIndexing(const PBXFileReference* file_reference,
|
| + const CompilerFlags compiler_flag) {
|
| 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_, compiler_flag));
|
| }
|
|
|
| PBXObjectClass PBXNativeTarget::Class() const {
|
| @@ -607,7 +616,8 @@ 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 CompilerFlags compiler_flag) {
|
| PBXFileReference* file_reference = sources_->AddSourceFile(source_path);
|
| base::StringPiece ext = FindExtension(&source_path);
|
| if (!IsSourceFileForIndexing(ext))
|
| @@ -631,7 +641,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, compiler_flag);
|
| }
|
|
|
| void PBXProject::AddAggregateTarget(const std::string& name,
|
|
|