• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2020 Huawei Device Co., Ltd.
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#
15if (defined(ohos_lite)) {
16  import("//build/lite/config/component/lite_component.gni")
17} else {
18  import("//build/ohos.gni")
19}
20import("libsec_src.gni")
21
22config("libsec_public_config") {
23  include_dirs = [ "include" ]
24}
25
26if (defined(ohos_lite)) {
27  # When the kernel is liteos_m, use //kernel/liteos_m/kal/libsec/BUILD.gn to compile.
28  if (current_toolchain == "//build/toolchain/linux:clang_x64" ||
29      ohos_kernel_type != "liteos_m") {
30    lite_library("libsec_static") {
31      target_type = "static_library"
32      sources = libsec_sources
33      public_configs = [ ":libsec_public_config" ]
34    }
35  } else if (ohos_kernel_type == "liteos_m") {
36    group("libsec_static") {
37    }
38  }
39  lite_library("libsec_shared") {
40    target_type = "shared_library"
41    sources = libsec_sources
42    public_configs = [ ":libsec_public_config" ]
43  }
44  group("sec_shared") {
45    deps = [ ":libsec_shared" ]
46  }
47} else {
48  ohos_static_library("libsec_static") {
49    sources = libsec_sources
50    all_dependent_configs = [ ":libsec_public_config" ]
51    public_configs = [ ":libsec_public_config" ]
52
53    cflags = [
54      "-D_INC_STRING_S",
55      "-D_INC_WCHAR_S",
56      "-D_SECIMP=//",
57      "-D_STDIO_S_DEFINED",
58      "-D_INC_STDIO_S",
59      "-D_INC_STDLIB_S",
60      "-D_INC_MEMORY_S",
61    ]
62    part_name = "bounds_checking_function"
63    subsystem_name = "thirdparty"
64  }
65  ohos_shared_library("libsec_shared") {
66    sources = libsec_sources
67    all_dependent_configs = [ ":libsec_public_config" ]
68    public_configs = [ ":libsec_public_config" ]
69
70    cflags = [
71      "-D_INC_STRING_S",
72      "-D_INC_WCHAR_S",
73      "-D_SECIMP=//",
74      "-D_STDIO_S_DEFINED",
75      "-D_INC_STDIO_S",
76      "-D_INC_STDLIB_S",
77      "-D_INC_MEMORY_S",
78    ]
79    innerapi_tags = [
80      "chipsetsdk",
81      "platformsdk",
82      "sasdk",
83    ]
84    part_name = "bounds_checking_function"
85    subsystem_name = "thirdparty"
86    install_images = [
87      "system",
88      "updater",
89      "ramdisk",
90    ]
91  }
92}
93