| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/gn/target.h" | 5 #include "tools/gn/target.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Track where the current settings came from for issuing errors. | 446 // Track where the current settings came from for issuing errors. |
| 447 const Label* pch_header_settings_from = NULL; | 447 const Label* pch_header_settings_from = NULL; |
| 448 if (config_values_.has_precompiled_headers()) | 448 if (config_values_.has_precompiled_headers()) |
| 449 pch_header_settings_from = &label(); | 449 pch_header_settings_from = &label(); |
| 450 | 450 |
| 451 for (ConfigValuesIterator iter(this); !iter.done(); iter.Next()) { | 451 for (ConfigValuesIterator iter(this); !iter.done(); iter.Next()) { |
| 452 if (!iter.GetCurrentConfig()) | 452 if (!iter.GetCurrentConfig()) |
| 453 continue; // Skip the one on the target itself. | 453 continue; // Skip the one on the target itself. |
| 454 | 454 |
| 455 const Config* config = iter.GetCurrentConfig(); | 455 const Config* config = iter.GetCurrentConfig(); |
| 456 const ConfigValues& cur = config->config_values(); | 456 const ConfigValues& cur = config->resolved_values(); |
| 457 if (!cur.has_precompiled_headers()) | 457 if (!cur.has_precompiled_headers()) |
| 458 continue; // This one has no precompiled header info, skip. | 458 continue; // This one has no precompiled header info, skip. |
| 459 | 459 |
| 460 if (config_values_.has_precompiled_headers()) { | 460 if (config_values_.has_precompiled_headers()) { |
| 461 // Already have a precompiled header values, the settings must match. | 461 // Already have a precompiled header values, the settings must match. |
| 462 if (config_values_.precompiled_header() != cur.precompiled_header() || | 462 if (config_values_.precompiled_header() != cur.precompiled_header() || |
| 463 config_values_.precompiled_source() != cur.precompiled_source()) { | 463 config_values_.precompiled_source() != cur.precompiled_source()) { |
| 464 *err = Err(defined_from(), | 464 *err = Err(defined_from(), |
| 465 "Precompiled header setting conflict.", | 465 "Precompiled header setting conflict.", |
| 466 "The target " + label().GetUserVisibleName(false) + "\n" | 466 "The target " + label().GetUserVisibleName(false) + "\n" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 return; // Not in output dir, this is OK. | 554 return; // Not in output dir, this is OK. |
| 555 | 555 |
| 556 // Tell the scheduler about unknown files. This will be noted for later so | 556 // Tell the scheduler about unknown files. This will be noted for later so |
| 557 // the list of files written by the GN build itself (often response files) | 557 // the list of files written by the GN build itself (often response files) |
| 558 // can be filtered out of this list. | 558 // can be filtered out of this list. |
| 559 OutputFile out_file(settings()->build_settings(), source); | 559 OutputFile out_file(settings()->build_settings(), source); |
| 560 std::set<const Target*> seen_targets; | 560 std::set<const Target*> seen_targets; |
| 561 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets)) | 561 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets)) |
| 562 g_scheduler->AddUnknownGeneratedInput(this, source); | 562 g_scheduler->AddUnknownGeneratedInput(this, source); |
| 563 } | 563 } |
| OLD | NEW |