| # Copyright 2022 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build/compiled_action.gni") |
| |
| lz4_install_targets = [ |
| "cobalt", |
| "crash_sandbox", |
| "noop_sandbox", |
| "one_app_only_sandbox", |
| ] |
| |
| template("lz4_compress_install_target") { |
| install_target_name = target_name |
| installable_target_name = invoker.installable_target_name |
| install_subdir = "lib" |
| source_name = "lib${installable_target_name}.so" |
| dest_name = "lib${installable_target_name}.lz4" |
| |
| compiled_action("${target_name}_run_lz4_compress") { |
| forward_variables_from(invoker, |
| [ |
| "testonly", |
| "install_target_name", |
| ]) |
| |
| tool = "//tools/lz4_compress" |
| |
| outputs = [ "$sb_install_output_dir/$install_subdir/$dest_name" ] |
| |
| inputs = [ "$sb_install_output_dir/$install_subdir/$source_name" ] |
| |
| args = |
| rebase_path(inputs, root_out_dir) + rebase_path(outputs, root_out_dir) |
| |
| deps = [ |
| ":$installable_target_name", |
| ":${install_target_name}_run_strip", |
| ] |
| } |
| } |