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  if (!defined(ohos_lite)) {
28    ohos_shared_library("seccomp") {
29      sources = [ "../../../services/modules/seccomp/seccomp_policy.c" ]
30
31      public_configs = [ ":seccomp_public_config" ]
32
33      include_dirs = [
34        "../include",
35        "../../../services/modules",
36        "../../../services/log",
37      ]
38
39      if (seccomp_enable_debug) {
40        include_dirs += [
41          "../../../interfaces/innerkits/include",
42          "../../../interfaces/innerkits/include/param",
43        ]
44
45        defines = [ "WITH_SECCOMP_DEBUG" ]
46      }
47
48      deps = [ "../../innerkits:libbegetutil" ]
49
50      external_deps = [
51        "bounds_checking_function:libsec_shared",
52        "config_policy:configpolicy_util",
53      ]
54
55      license_file = "//base/startup/init/LICENSE"
56
57      part_name = "init"
58      subsystem_name = "startup"
59
60      install_enable = true
61      install_images = [ "system" ]
62    }
63  }
64} else {
65  group("seccomp") {
66  }
67}
68