xref: /aosp_15_r20/external/perfetto/gn/perfetto_check_build_deps.gni (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2020 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("perfetto.gni")
16
17# This template, when instantiated, runs
18# tools/install-build-deps --check-only ${args}.
19# It's used to ensure that deps are current before building.
20template("perfetto_check_build_deps") {
21  if (perfetto_build_standalone && !skip_buildtools_check) {
22    action(target_name) {
23      out_file = "$target_gen_dir/$target_name.check"
24      out_file_path = rebase_path(out_file, root_build_dir)
25      script = "${perfetto_root_path}tools/install-build-deps"
26      args = [ "--check-only=${out_file_path}" ]
27      args += invoker.args
28      inputs = []
29      if (defined(invoker.inputs)) {
30        inputs += invoker.inputs
31      }
32      outputs = [ out_file ]
33    }
34  } else {
35    group(target_name) {
36      not_needed(invoker, "*")
37    }
38  }
39}
40