• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15
16config("seccomp_public_config") {
17  include_dirs = [ "include" ]
18}
19
20if (defined(build_seccomp) && build_seccomp) {
21  if (build_variant == "root") {
22    seccomp_enable_debug = true
23  } else {
24    seccomp_enable_debug = false
25  }
26
27  ohos_shared_library("seccomp") {
28    sources = [ "../../../services/modules/seccomp/seccomp_policy.c" ]
29
30    public_configs = [ ":seccomp_public_config" ]
31
32    include_dirs = [
33      "../include",
34      "../../../services/modules",
35      "../../../services/log",
36    ]
37
38    if (seccomp_enable_debug) {
39      include_dirs += [
40        "../../../services/include",
41        "../../../services/include/param",
42      ]
43
44      defines = [ "WITH_SECCOMP_DEBUG" ]
45    }
46
47    deps = [ "../../innerkits:libbegetutil" ]
48
49    external_deps = [
50      "bounds_checking_function:libsec_shared",
51      "config_policy:configpolicy_util",
52    ]
53
54    license_file = "//base/startup/init/LICENSE"
55
56    part_name = "init"
57    subsystem_name = "startup"
58
59    install_enable = true
60    install_images = [ "system" ]
61  }
62} else {
63  group("seccomp") {
64  }
65}
66