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

Unified Diff: tools/gn/config_values_generator.cc

Issue 1606553002: Add support for Mac/iOS application bundles to GN tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base_unittests builds and pass all tests with GN Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: tools/gn/config_values_generator.cc
diff --git a/tools/gn/config_values_generator.cc b/tools/gn/config_values_generator.cc
index 3cc8235face1472d3c858b8f82c736e5c45d12f8..db2ed1e77ca13473f502f133c9bcc1963bfb460d 100644
--- a/tools/gn/config_values_generator.cc
+++ b/tools/gn/config_values_generator.cc
@@ -44,6 +44,23 @@ void GetDirList(
(config_values->*accessor)().swap(result);
}
+void GetSrcList(
+ Scope* scope,
+ const char* var_name,
+ ConfigValues* config_values,
+ const SourceDir input_dir,
+ std::vector<SourceFile>& (ConfigValues::* accessor)(),
+ Err* err) {
+ const Value* value = scope->GetValue(var_name, true);
+ if (!value)
+ return; // No value, empty input and succeed.
+
+ std::vector<SourceFile> result;
+ ExtractListOfRelativeFiles(scope->settings()->build_settings(),
+ *value, input_dir, &result, err);
+ (config_values->*accessor)().swap(result);
+}
+
} // namespace
ConfigValuesGenerator::ConfigValuesGenerator(
@@ -66,6 +83,9 @@ void ConfigValuesGenerator::Run() {
#define FILL_DIR_CONFIG_VALUE(name) \
GetDirList(scope_, #name, config_values_, input_dir_, \
&ConfigValues::name, err_);
+#define FILL_SRC_CONFIG_VALUE(name) \
+ GetSrcList(scope_, #name, config_values_, input_dir_, \
+ &ConfigValues::name, err_);
FILL_STRING_CONFIG_VALUE(asmflags)
FILL_STRING_CONFIG_VALUE(cflags)
@@ -77,9 +97,11 @@ void ConfigValuesGenerator::Run() {
FILL_DIR_CONFIG_VALUE( include_dirs)
FILL_STRING_CONFIG_VALUE(ldflags)
FILL_DIR_CONFIG_VALUE( lib_dirs)
+ FILL_SRC_CONFIG_VALUE( bundle_data)
#undef FILL_STRING_CONFIG_VALUE
#undef FILL_DIR_CONFIG_VALUE
+#undef FILL_SRC_CONFIG_VALUE
// Libs
const Value* libs_value = scope_->GetValue("libs", true);

Powered by Google App Engine
This is Rietveld 408576698