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

Unified Diff: build/config/mac/rules.gni

Issue 1878033002: [Mac/GN] Add new template for creating .plugin loadable modules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « no previous file | ppapi/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/rules.gni
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni
index 4a910d8b8f76a0517bcc337f8304831e946d743b..cdb12d9a69026a1b3b508ef88e275fff5ae15f49 100644
--- a/build/config/mac/rules.gni
+++ b/build/config/mac/rules.gni
@@ -278,3 +278,58 @@ template("mac_app_bundle") {
bundle_executable_dir = "$bundle_root_dir/MacOS"
}
}
+
+# Template to package a loadable_module into a .plugin bundle.
+#
+# This takes no extra arguments that differ from a loadable_module.
+template("mac_plugin_bundle") {
+ assert(defined(invoker.deps),
+ "Dependencies must be specified for $target_name")
+
+ _target_name = target_name
+ _loadable_module_target = _target_name + "_loadable_module"
+ _loadable_module_bundle_data = _loadable_module_target + "_bundle_data"
+
+ loadable_module(_loadable_module_target) {
+ visibility = [ ":$_loadable_module_bundle_data" ]
+ forward_variables_from(invoker,
+ "*",
+ [
+ "assert_no_deps",
+ "data_deps",
+ "output_name",
+ "visibility",
+ ])
+ }
+
+ bundle_data(_loadable_module_bundle_data) {
+ visibility = [ ":$_target_name" ]
+ sources = [
+ "$root_out_dir/${_loadable_module_target}.so",
+ ]
+ outputs = [
+ "{{bundle_executable_dir}}/$_target_name",
+ ]
+ public_deps = [
+ ":$_loadable_module_target",
+ ]
+ }
+
+ create_bundle(_target_name) {
+ forward_variables_from(invoker,
+ [
+ "data_deps",
+ "deps",
+ "public_deps",
+ "testonly",
+ "visibility",
+ ])
+ if (!defined(deps)) {
+ deps = []
+ }
+ deps += [ ":$_loadable_module_bundle_data" ]
+
+ bundle_root_dir = "$root_out_dir/$_target_name.plugin/Contents"
+ bundle_executable_dir = "$bundle_root_dir/MacOS"
+ }
+}
« no previous file with comments | « no previous file | ppapi/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698