• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2019-2021 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
14if (defined(ohos_lite)) {
15  config("cjson_config") {
16    include_dirs = [ "//third_party/cJSON" ]
17    ldflags = [ "-lm" ]
18    defines = [ "CJSON_NESTING_LIMIT=(128)" ]
19  }
20  cjson_sources = [
21    "cJSON.c",
22    "cJSON_Utils.c",
23  ]
24
25  if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
26    cflags = [
27      "--diag_suppress",
28      "Pe513",
29    ]
30    cflags_cc = cflags
31  }
32  static_library("cjson_static") {
33    sources = cjson_sources
34    public_configs = [ ":cjson_config" ]
35  }
36
37  shared_library("cjson_shared") {
38    sources = cjson_sources
39    public_configs = [ ":cjson_config" ]
40  }
41} else {
42  import("//build/ohos.gni")
43  config("cJSON_config") {
44    include_dirs = [ "//third_party/cJSON" ]
45    defines = [ "CJSON_NESTING_LIMIT=(128)" ]
46  }
47  ohos_static_library("cjson_static") {
48    branch_protector_ret = "pac_ret"
49    sources = [ "cJSON.c" ]
50    public_configs = [ ":cJSON_config" ]
51    part_name = "cJSON"
52    subsystem_name = "thirdparty"
53  }
54  ohos_shared_library("cjson") {
55    branch_protector_ret = "pac_ret"
56    sources = [ "cJSON.c" ]
57    public_configs = [ ":cJSON_config" ]
58    innerapi_tags = [
59      "chipsetsdk",
60      "platformsdk_indirect",
61    ]
62    part_name = "cJSON"
63    subsystem_name = "thirdparty"
64    install_images = [
65      "system",
66      "updater",
67    ]
68  }
69}
70