[build] Don't create a second copy of executables compiled with -fPIC.
build.py -mrelease runtime 4169 -> 2711 build steps Change-Id: I679b2d7b34fd598deffc66e3bf10c48b02e9d764 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398944 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
Commit Queue
parent
63382832fd
commit
7381222387
+36
-15
@@ -474,22 +474,43 @@ foreach(_target_type,
|
||||
"executable",
|
||||
"loadable_module",
|
||||
]) {
|
||||
template(_target_type) {
|
||||
target(_target_type, target_name) {
|
||||
forward_variables_from(invoker, "*", [ "no_default_deps" ])
|
||||
if (!defined(deps)) {
|
||||
deps = []
|
||||
if (!is_shared_library) {
|
||||
template(_target_type) {
|
||||
target(_target_type, target_name) {
|
||||
forward_variables_from(invoker, "*", [ "no_default_deps" ])
|
||||
if (!defined(deps)) {
|
||||
deps = []
|
||||
}
|
||||
if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) {
|
||||
if (use_flutter_cxx) {
|
||||
deps += [ "//third_party/libcxx" ]
|
||||
}
|
||||
if (is_fuchsia) {
|
||||
deps += [
|
||||
"//build/fuchsia/config/clang:c++-runtime-deps",
|
||||
"//third_party/fuchsia/gn-sdk/src/config:runtime_library_group",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!defined(invoker.no_default_deps) || !invoker.no_default_deps) {
|
||||
if (use_flutter_cxx) {
|
||||
deps += [ "//third_party/libcxx" ]
|
||||
}
|
||||
if (is_fuchsia) {
|
||||
deps += [
|
||||
"//build/fuchsia/config/clang:c++-runtime-deps",
|
||||
"//third_party/fuchsia/gn-sdk/src/config:runtime_library_group",
|
||||
]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
# Forward to the main toolchain so that
|
||||
# shared_libary("foo") {
|
||||
# deps = [ ":bar" ]
|
||||
# }
|
||||
# executable("bar") {}
|
||||
# doesn't create an extra copy of bar.
|
||||
template(_target_type) {
|
||||
group(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"testonly",
|
||||
"visibility",
|
||||
])
|
||||
not_needed(invoker, "*")
|
||||
main_toolchain = string_replace(current_toolchain, "_shared", "")
|
||||
public_deps = [ ":$target_name($main_toolchain)" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user