| 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 #ifndef TOOLS_GN_NINJA_HELPER_H_ | 5 #ifndef TOOLS_GN_NINJA_HELPER_H_ |
| 6 #define TOOLS_GN_NINJA_HELPER_H_ | 6 #define TOOLS_GN_NINJA_HELPER_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // Returns the filename produced by the given output. | 46 // Returns the filename produced by the given output. |
| 47 // | 47 // |
| 48 // Some targets make multiple files (like a .dll and an import library). This | 48 // Some targets make multiple files (like a .dll and an import library). This |
| 49 // function returns the name of the file other targets should depend on and | 49 // function returns the name of the file other targets should depend on and |
| 50 // link to (so in this example, the import library). | 50 // link to (so in this example, the import library). |
| 51 OutputFile GetTargetOutputFile(const Target* target) const; | 51 OutputFile GetTargetOutputFile(const Target* target) const; |
| 52 | 52 |
| 53 // Returns the prefix for rules on the given toolchain. We need this to | 53 // Returns the prefix for rules on the given toolchain. We need this to |
| 54 // disambiguate a given rule for each toolchain. | 54 // disambiguate a given rule for each toolchain. |
| 55 std::string GetRulePrefix(const Toolchain* toolchain) const; | 55 std::string GetRulePrefix(const Settings* settings) const; |
| 56 | 56 |
| 57 // Returns the name of the rule name for the given toolchain and file/target | 57 // Returns the name of the rule name for the given toolchain and file/target |
| 58 // type. Returns the empty string for source files with no command. | 58 // type. Returns the empty string for source files with no command. |
| 59 std::string GetRuleForSourceType(const Settings* settings, | 59 std::string GetRuleForSourceType(const Settings* settings, |
| 60 const Toolchain* toolchain, | |
| 61 SourceFileType type) const; | 60 SourceFileType type) const; |
| 62 | 61 |
| 63 // Returns the relative directory in either slashes or the system separator | 62 // Returns the relative directory in either slashes or the system separator |
| 64 // from the ninja directory (e.g. "out/Debug") to the source root (e.g. | 63 // from the ninja directory (e.g. "out/Debug") to the source root (e.g. |
| 65 // "../.."). It has no terminating slash. | 64 // "../.."). It has no terminating slash. |
| 66 const std::string& build_to_src_no_last_slash() const { | 65 const std::string& build_to_src_no_last_slash() const { |
| 67 return build_to_src_no_last_slash_; | 66 return build_to_src_no_last_slash_; |
| 68 } | 67 } |
| 69 const std::string& build_to_src_system_no_last_slash() const { | 68 const std::string& build_to_src_system_no_last_slash() const { |
| 70 return build_to_src_system_no_last_slash_; | 69 return build_to_src_system_no_last_slash_; |
| 71 } | 70 } |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 const BuildSettings* build_settings_; | 73 const BuildSettings* build_settings_; |
| 75 | 74 |
| 76 std::string build_to_src_no_last_slash_; | 75 std::string build_to_src_no_last_slash_; |
| 77 std::string build_to_src_system_no_last_slash_; | 76 std::string build_to_src_system_no_last_slash_; |
| 78 | 77 |
| 79 DISALLOW_COPY_AND_ASSIGN(NinjaHelper); | 78 DISALLOW_COPY_AND_ASSIGN(NinjaHelper); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 #endif // TOOLS_GN_NINJA_HELPER_H_ | 81 #endif // TOOLS_GN_NINJA_HELPER_H_ |
| OLD | NEW |