Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: tools/gn/config_values_generator.cc

Issue 1530183005: Special-case paths that appear in libs by not prefixing them with -l. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: treat source_file libs as inputs Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/config_values_generator.h" 5 #include "tools/gn/config_values_generator.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "tools/gn/config_values.h" 8 #include "tools/gn/config_values.h"
9 #include "tools/gn/scope.h" 9 #include "tools/gn/scope.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FILL_STRING_CONFIG_VALUE(asmflags) 72 FILL_STRING_CONFIG_VALUE(asmflags)
73 FILL_STRING_CONFIG_VALUE(cflags) 73 FILL_STRING_CONFIG_VALUE(cflags)
74 FILL_STRING_CONFIG_VALUE(cflags_c) 74 FILL_STRING_CONFIG_VALUE(cflags_c)
75 FILL_STRING_CONFIG_VALUE(cflags_cc) 75 FILL_STRING_CONFIG_VALUE(cflags_cc)
76 FILL_STRING_CONFIG_VALUE(cflags_objc) 76 FILL_STRING_CONFIG_VALUE(cflags_objc)
77 FILL_STRING_CONFIG_VALUE(cflags_objcc) 77 FILL_STRING_CONFIG_VALUE(cflags_objcc)
78 FILL_STRING_CONFIG_VALUE(defines) 78 FILL_STRING_CONFIG_VALUE(defines)
79 FILL_DIR_CONFIG_VALUE( include_dirs) 79 FILL_DIR_CONFIG_VALUE( include_dirs)
80 FILL_STRING_CONFIG_VALUE(ldflags) 80 FILL_STRING_CONFIG_VALUE(ldflags)
81 FILL_DIR_CONFIG_VALUE( lib_dirs) 81 FILL_DIR_CONFIG_VALUE( lib_dirs)
82 FILL_STRING_CONFIG_VALUE(libs)
83 82
84 #undef FILL_STRING_CONFIG_VALUE 83 #undef FILL_STRING_CONFIG_VALUE
85 #undef FILL_DIR_CONFIG_VALUE 84 #undef FILL_DIR_CONFIG_VALUE
86 85
86 // Libs
87 const Value* libs_value = scope_->GetValue("libs", true);
88 if (libs_value) {
89 std::vector<LibFile> result;
brettw 2015/12/18 00:04:55 I think you can avoid this temporary and have Extr
agrieve 2015/12/18 15:39:07 Done.
90 ExtractListOfLibs(scope_->settings()->build_settings(), *libs_value,
91 input_dir_, &result, err_);
92 config_values_->libs().swap(result);
93 }
94
87 // Precompiled headers. 95 // Precompiled headers.
88 const Value* precompiled_header_value = 96 const Value* precompiled_header_value =
89 scope_->GetValue(variables::kPrecompiledHeader, true); 97 scope_->GetValue(variables::kPrecompiledHeader, true);
90 if (precompiled_header_value) { 98 if (precompiled_header_value) {
91 if (!precompiled_header_value->VerifyTypeIs(Value::STRING, err_)) 99 if (!precompiled_header_value->VerifyTypeIs(Value::STRING, err_))
92 return; 100 return;
93 101
94 // Check for common errors. This is a string and not a file. 102 // Check for common errors. This is a string and not a file.
95 const std::string& pch_string = precompiled_header_value->string_value(); 103 const std::string& pch_string = precompiled_header_value->string_value();
96 if (base::StartsWith(pch_string, "//", base::CompareCase::SENSITIVE)) { 104 if (base::StartsWith(pch_string, "//", base::CompareCase::SENSITIVE)) {
(...skipping 10 matching lines...) Expand all
107 scope_->GetValue(variables::kPrecompiledSource, true); 115 scope_->GetValue(variables::kPrecompiledSource, true);
108 if (precompiled_source_value) { 116 if (precompiled_source_value) {
109 config_values_->set_precompiled_source( 117 config_values_->set_precompiled_source(
110 input_dir_.ResolveRelativeFile( 118 input_dir_.ResolveRelativeFile(
111 *precompiled_source_value, err_, 119 *precompiled_source_value, err_,
112 scope_->settings()->build_settings()->root_path_utf8())); 120 scope_->settings()->build_settings()->root_path_utf8()));
113 if (err_->has_error()) 121 if (err_->has_error())
114 return; 122 return;
115 } 123 }
116 } 124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698