BUILD.gn 1.9 KB
Newer Older
C
cheng_jinsong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
# Copyright (c) 2023 Huawei Device Co., Ltd.
# 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("//base/startup/init/begetd.gni")
import("//build/ohos.gni")

comm_include = [
  ".",
  "..",
  "../../init/include",
  "../../include",
  "../../include/param",
]

ohos_shared_library("init_context") {
  sources = [ "init_context.c" ]

  include_dirs = comm_include

  include_dirs += [ "../../init/include" ]

32 33
  external_deps = [ "init:libinit_module_engine" ]

C
cheng_jinsong 已提交
34
  defines = [ "INIT_SUPPORT_CHIPSET_INIT" ]
35 36 37 38 39
  if (build_selinux) {
    external_deps += [
      "selinux:libload_policy",
      "selinux:librestorecon",
    ]
C
cheng_jinsong 已提交
40
    defines += [ "WITH_SELINUX" ]
41
  }
C
cheng_jinsong 已提交
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

  deps = [
    "//third_party/bounds_checking_function:libsec_shared",
    "//third_party/selinux:libselinux",
  ]

  part_name = "init"
  subsystem_name = "startup"
  if (target_cpu == "arm64") {
    module_install_dir = "lib64/init"
  } else {
    module_install_dir = "lib/init"
  }
}

config("initcontext_static_config") {
  include_dirs = comm_include
}

ohos_source_set("initcontext_static") {
  sources = [ "init_context_static.c" ]
  include_dirs = comm_include
C
cheng_jinsong 已提交
64
  defines = [ "INIT_SUPPORT_CHIPSET_INIT" ]
C
cheng_jinsong 已提交
65 66 67 68 69 70
  public_configs = [ ":initcontext_static_config" ]
  public_configs += [ "../../../interfaces/innerkits/init_module_engine:init_module_engine_exported_config" ]
  deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
  part_name = "init"
  subsystem_name = "startup"
}