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 "../interfaces/inner_api/syscap_interface.c", 31] 32 33ohos_shared_library("systemcapability") { 34 include_dirs = [ 35 "../src", 36 "../interfaces/inner_api", 37 "../include", 38 ] 39 include_dirs += [ syscap_codec_config_path ] 40 41 sources = [ "napi_query_syscap.cpp" ] 42 sources += sources_platform_common 43 44 deps = [ 45 ":query_syscap_js", 46 "//third_party/bounds_checking_function:libsec_static", 47 ] 48 49 if (syscap_codec_config_extern_path != "") { 50 deps += [ "..:gen_syscap_define_custom" ] 51 inputs = [ "${root_build_dir}/syscap_define_custom.h" ] 52 include_dirs += [ "${root_build_dir}" ] 53 cflags = [ "-DSYSCAP_DEFINE_EXTERN_ENABLE" ] 54 } 55 56 external_deps = [ "napi:ace_napi" ] 57 58 if (defined(ohos_lite)) { 59 deps += [ "//build/lite/config/component/cJSON:cjson_static" ] 60 } else { 61 deps += [ "//third_party/cJSON:cjson_static" ] 62 } 63 64 relative_install_dir = "module" 65 subsystem_name = "developtools" 66 part_name = "syscap_codec" 67} 68