1# Copyright (C) 2022-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")
15import("//build/ohos/ace/ace.gni")
16import("../config.gni")
17
18base_output_path = get_label_info(":query_syscap", "target_out_dir")
19query_syscap_obj_path = base_output_path + "/query_syscap.o"
20
21gen_js_obj("query_syscap_js") {
22  input = "query_syscap.js"
23  output = query_syscap_obj_path
24}
25
26sources_platform_common = [
27  "../src/syscap_tool.c",
28  "../src/create_pcid.c",
29  "../src/endian_internal.c",
30  "../src/context_tool.c",
31  "../interfaces/inner_api/syscap_interface.c",
32]
33
34ohos_shared_library("systemcapability") {
35  include_dirs = [
36    "../src",
37    "../interfaces/inner_api",
38    "../include",
39  ]
40  include_dirs += [ syscap_codec_config_path ]
41
42  sources = [ "napi_query_syscap.cpp" ]
43  sources += sources_platform_common
44
45  deps = [ ":query_syscap_js" ]
46  external_deps = [
47    "bounds_checking_function:libsec_static",
48    "napi:ace_napi",
49  ]
50
51  if (syscap_codec_config_extern_path != "") {
52    deps += [ "..:gen_syscap_define_custom" ]
53    inputs = [ "${root_build_dir}/syscap_define_custom.h" ]
54    include_dirs += [ "${root_build_dir}" ]
55    cflags = [ "-DSYSCAP_DEFINE_EXTERN_ENABLE" ]
56  }
57
58  if (defined(ohos_lite)) {
59    deps += [ "//build/lite/config/component/cJSON:cjson_static" ]
60  } else {
61    external_deps += [ "cJSON:cjson_static" ]
62  }
63
64  relative_install_dir = "module"
65  subsystem_name = "developtools"
66  part_name = "syscap_codec"
67}
68