| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_VISUAL_STUDIO_UTILS_H_ | 5 #ifndef TOOLS_GN_VISUAL_STUDIO_UTILS_H_ |
| 6 #define TOOLS_GN_VISUAL_STUDIO_UTILS_H_ | 6 #define TOOLS_GN_VISUAL_STUDIO_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 // Some compiler options which will be written to project file. We don't need to | 10 // Some compiler options which will be written to project file. We don't need to |
| 11 // specify all options because generated project file is going to be used only | 11 // specify all options because generated project file is going to be used only |
| 12 // for compilation of single file. For real build ninja files are used. | 12 // for compilation of single file. For real build ninja files are used. |
| 13 struct CompilerOptions { | 13 struct CompilerOptions { |
| 14 CompilerOptions(); | 14 CompilerOptions(); |
| 15 ~CompilerOptions(); | 15 ~CompilerOptions(); |
| 16 | 16 |
| 17 std::string additional_options; | 17 std::string additional_options; |
| 18 std::string buffer_security_check; | 18 std::string buffer_security_check; |
| 19 std::string forced_include_files; | 19 std::string forced_include_files; |
| 20 std::string disable_specific_warnings; | 20 std::string disable_specific_warnings; |
| 21 std::string optimization; | 21 std::string optimization; |
| 22 std::string runtime_library; | 22 std::string runtime_library; |
| 23 std::string treat_warning_as_error; | 23 std::string treat_warning_as_error; |
| 24 std::string warning_level; | 24 std::string warning_level; |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Some linker options which will be written to project file. We don't need to |
| 28 // specify all options because generated project file is going to be used only |
| 29 // for compilation of single file. For real build ninja files are used. |
| 30 struct LinkerOptions { |
| 31 LinkerOptions(); |
| 32 ~LinkerOptions(); |
| 33 |
| 34 std::string subsystem; |
| 35 }; |
| 36 |
| 27 // Generates something which looks like a GUID, but depends only on the name and | 37 // Generates something which looks like a GUID, but depends only on the name and |
| 28 // seed. This means the same name / seed will always generate the same GUID, so | 38 // seed. This means the same name / seed will always generate the same GUID, so |
| 29 // that projects and solutions which refer to each other can explicitly | 39 // that projects and solutions which refer to each other can explicitly |
| 30 // determine the GUID to refer to explicitly. It also means that the GUID will | 40 // determine the GUID to refer to explicitly. It also means that the GUID will |
| 31 // not change when the project for a target is rebuilt. | 41 // not change when the project for a target is rebuilt. |
| 32 std::string MakeGuid(const std::string& entry_path, const std::string& seed); | 42 std::string MakeGuid(const std::string& entry_path, const std::string& seed); |
| 33 | 43 |
| 34 // Parses |cflag| value and stores it in |options|. | 44 // Parses |cflag| value and stores it in |options|. |
| 35 void ParseCompilerOption(const std::string& cflag, CompilerOptions* options); | 45 void ParseCompilerOption(const std::string& cflag, CompilerOptions* options); |
| 36 | 46 |
| 47 // Parses |ldflags| value and stores it in |options|. |
| 48 void ParseLinkerOption(const std::string& ldflag, LinkerOptions* options); |
| 49 |
| 37 #endif // TOOLS_GN_VISUAL_STUDIO_UTILS_H_ | 50 #endif // TOOLS_GN_VISUAL_STUDIO_UTILS_H_ |
| OLD | NEW |