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

Unified Diff: services/service_manager/public/cpp/service.gni

Issue 2566663004: Revert of Build services as standalone executables (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: services/service_manager/public/cpp/service.gni
diff --git a/services/service_manager/public/cpp/service.gni b/services/service_manager/public/cpp/service.gni
index 2fb99919ab7bdf2a4f6765a11e642c61be28e014..5faeb259bb86578856843f8ab23e5e1a11cd6324 100644
--- a/services/service_manager/public/cpp/service.gni
+++ b/services/service_manager/public/cpp/service.gni
@@ -11,13 +11,12 @@
}
# Generates a Service "package", which includes:
+# . A self-named subdirectory
+# . A binary .library
+# . A resources subdirectory alongside .library that contains the contents of
+# "resources"
#
-# - A self-named subdirectory
-# - A binary .service executable
-# - A resources subdirectory alongside the executable, which contains the
-# contents of "resources"
-#
-# The parameters of this template are those of an executable
+# The parameters of this template are those of a shared library.
template("service") {
base_target_name = target_name
if (defined(invoker.output_name)) {
@@ -26,13 +25,12 @@
final_target_name = target_name
- service_deps = []
+ library_deps = []
if (defined(invoker.deps)) {
- service_deps += invoker.deps
+ library_deps += invoker.deps
}
- service_data_deps =
- [ "//services/service_manager/public/cpp/standalone_service:main" ]
+ library_data_deps = []
if (defined(invoker.resources)) {
copy_step_name = "${base_target_name}__copy_resources"
@@ -44,22 +42,16 @@
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
- deps = service_deps
+ deps = library_deps
}
- service_data_deps += [ ":$copy_step_name" ]
+ library_data_deps += [ ":$copy_step_name" ]
}
- if (defined(invoker.data_deps)) {
- service_data_deps += invoker.data_deps
- }
+ output = base_target_name + ".library"
+ library_target_name = base_target_name + "_library"
+ library_name = "${shlib_prefix}${library_target_name}${shlib_extension}"
- executable_target_name = base_target_name + "_executable"
- executable_name = base_target_name + ".service"
-
- executable(executable_target_name) {
- output_name = base_target_name
- output_extension = "service"
-
+ shared_library(library_target_name) {
if (defined(invoker.cflags)) {
cflags = invoker.cflags
}
@@ -91,13 +83,22 @@
libs = invoker.libs
}
- data_deps = service_data_deps
+ data_deps = []
+ if (!defined(invoker.avoid_runner_cycle) || !invoker.avoid_runner_cycle) {
+ # Give the user an out; as some Services are depended on by the runner.
+ data_deps += [ "//services/service_manager/standalone" ]
+ }
+ if (defined(invoker.data_deps)) {
+ data_deps += invoker.data_deps
+ }
+ data_deps += library_data_deps
deps = [
- "//services/service_manager/public/cpp/standalone_service:main",
+ "//mojo/public/c/system:set_thunks_for_app",
+ "//services/service_manager/public/cpp:application_support",
]
- deps += service_deps
+ deps += library_deps
if (defined(invoker.public_deps)) {
public_deps = invoker.public_deps
}
@@ -137,20 +138,14 @@
"visibility",
])
deps = [
- ":${executable_target_name}",
+ ":${library_target_name}",
]
- # NOTE: We have to explicitly inherit the same data_deps as the executable
- # target itself, rather than specifying a data depenedency on the executable
- # target. This avoids needless duplication of service binary artifacts in
- # test isolates, as the executable is unused in its original location.
- data_deps = service_data_deps
-
sources = [
- "${root_out_dir}/${executable_name}",
+ "${root_shlib_dir}/${library_name}",
]
outputs = [
- "${root_out_dir}/${packages_directory}/${base_target_name}/${executable_name}",
+ "${root_out_dir}/${packages_directory}/${base_target_name}/${output}",
]
}
}
« no previous file with comments | « services/service_manager/public/cpp/service.h ('k') | services/service_manager/public/cpp/standalone_service/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698