• 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 = [ "." ]
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 = [ "." ]
45    defines = [ "CJSON_NESTING_LIMIT=(128)" ]
46  }
47  ohos_static_library("cjson_static") {
48    sources = [ "cJSON.c" ]
49    public_configs = [ ":cJSON_config" ]
50    part_name = "cJSON"
51    subsystem_name = "thirdparty"
52  }
53  ohos_shared_library("cjson") {
54    deps = [ ":cjson_static" ]
55    public_configs = [ ":cJSON_config" ]
56    innerapi_tags = [
57      "chipsetsdk",
58      "platformsdk_indirect",
59    ]
60    part_name = "cJSON"
61    subsystem_name = "thirdparty"
62    install_images = [
63      "system",
64      "updater",
65    ]
66  }
67}
68