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

Unified Diff: tools/gn/binary_target_generator.cc

Issue 1386783003: [GN]: Support for loadable modules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark comments Created 5 years, 2 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/binary_target_generator.cc
diff --git a/tools/gn/binary_target_generator.cc b/tools/gn/binary_target_generator.cc
index 923d0edd7a95f37ac66538e62a67cefcf68aac52..3c2a3050b198bb5111cc49541dcfa668ac29d458 100644
--- a/tools/gn/binary_target_generator.cc
+++ b/tools/gn/binary_target_generator.cc
@@ -55,6 +55,9 @@ void BinaryTargetGenerator::DoRun() {
if (!FillCompleteStaticLib())
return;
+ if (!FillDarwinBundle())
+ return;
+
// Config values (compiler flags, etc.) set directly on this target.
ConfigValuesGenerator gen(&target_->config_values(), scope_,
scope_->GetSourceDir(), err_);
@@ -131,3 +134,31 @@ bool BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
target_->allow_circular_includes_from().insert(cur);
return true;
}
+
+bool BinaryTargetGenerator::FillDarwinBundle() {
+ // This flag only applies to executable and shared_library target types.
+ if (target_->output_type() == Target::STATIC_LIBRARY)
+ return true;
+
+ const Value* value = scope_->GetValue(variables::kDarwinBundle, true);
+ if (value) {
+ if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
+ return false;
+ target_->set_darwin_bundle(value->boolean_value());
+ }
+ return true;
+}
+
+bool BinaryTargetGenerator::FillLoadableModule() {
+ // This flag only applies to shared_library target types.
+ if (target_->output_type() != Target::SHARED_LIBRARY)
+ return true;
+
+ const Value* value = scope_->GetValue(variables::kLoadableModule, true);
+ if (value) {
+ if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
+ return false;
+ target_->set_loadable_module(value->boolean_value());
+ }
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698