| 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/ninja_script_target_writer.h" | 5 #include "tools/gn/ninja_script_target_writer.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
| 9 #include "tools/gn/file_template.h" | 9 #include "tools/gn/file_template.h" |
| 10 #include "tools/gn/string_utils.h" | 10 #include "tools/gn/string_utils.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (settings_->IsWin()) { | 68 if (settings_->IsWin()) { |
| 69 // Send through gyp-win-tool and use a response file. | 69 // Send through gyp-win-tool and use a response file. |
| 70 std::string rspfile = custom_rule_name; | 70 std::string rspfile = custom_rule_name; |
| 71 if (has_sources()) | 71 if (has_sources()) |
| 72 rspfile += ".$unique_name"; | 72 rspfile += ".$unique_name"; |
| 73 rspfile += ".rsp"; | 73 rspfile += ".rsp"; |
| 74 | 74 |
| 75 out_ << "rule " << custom_rule_name << std::endl; | 75 out_ << "rule " << custom_rule_name << std::endl; |
| 76 out_ << " command = "; | 76 out_ << " command = "; |
| 77 path_output_.WriteFile(out_, settings_->build_settings()->python_path()); | 77 path_output_.WriteFile(out_, settings_->build_settings()->python_path()); |
| 78 out_ << " gyp-win-tool action-wrapper $arch " << rspfile << std::endl; | 78 // TODO(brettw) this hardcodes "environment.x86" which is something that |
| 79 // the Chrome Windows toolchain writes. We should have a way to invoke |
| 80 // python without requiring this gyp_win_tool thing. |
| 81 out_ << " gyp-win-tool action-wrapper environment.x86 " << rspfile |
| 82 << std::endl; |
| 79 out_ << " description = CUSTOM " << target_label << std::endl; | 83 out_ << " description = CUSTOM " << target_label << std::endl; |
| 80 out_ << " restat = 1" << std::endl; | 84 out_ << " restat = 1" << std::endl; |
| 81 out_ << " rspfile = " << rspfile << std::endl; | 85 out_ << " rspfile = " << rspfile << std::endl; |
| 82 | 86 |
| 83 // The build command goes in the rsp file. | 87 // The build command goes in the rsp file. |
| 84 out_ << " rspfile_content = "; | 88 out_ << " rspfile_content = "; |
| 85 path_output_.WriteFile(out_, settings_->build_settings()->python_path()); | 89 path_output_.WriteFile(out_, settings_->build_settings()->python_path()); |
| 86 out_ << " "; | 90 out_ << " "; |
| 87 path_output_.WriteFile(out_, target_->script_values().script()); | 91 path_output_.WriteFile(out_, target_->script_values().script()); |
| 88 args_template.WriteWithNinjaExpansions(out_); | 92 args_template.WriteWithNinjaExpansions(out_); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 std::vector<OutputFile>* output_files) { | 168 std::vector<OutputFile>* output_files) { |
| 165 std::vector<std::string> output_template_result; | 169 std::vector<std::string> output_template_result; |
| 166 output_template.ApplyString(source.value(), &output_template_result); | 170 output_template.ApplyString(source.value(), &output_template_result); |
| 167 for (size_t out_i = 0; out_i < output_template_result.size(); out_i++) { | 171 for (size_t out_i = 0; out_i < output_template_result.size(); out_i++) { |
| 168 OutputFile output_path(output_template_result[out_i]); | 172 OutputFile output_path(output_template_result[out_i]); |
| 169 output_files->push_back(output_path); | 173 output_files->push_back(output_path); |
| 170 out_ << " "; | 174 out_ << " "; |
| 171 path_output_.WriteFile(out_, output_path); | 175 path_output_.WriteFile(out_, output_path); |
| 172 } | 176 } |
| 173 } | 177 } |
| OLD | NEW |