1# Copyright (C) 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") 15 16config("pubilc") { 17 include_dirs = [ "include" ] 18} 19 20sources_platform_common = [ 21 "./src/syscap_tool.c", 22 "./src/endian_internal.c", 23] 24 25ohos_executable("syscap_tool_bin") { 26 output_name = "syscap_tool" 27 install_enable = true 28 include_dirs = [ "src" ] 29 public_configs = [ ":pubilc" ] 30 defines = [] 31 32 if (is_mingw) { 33 defines += [ "_POSIX_" ] 34 } 35 36 sources = [ "./src/main.c" ] 37 sources += sources_platform_common 38 39 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 40 41 if (defined(ohos_lite)) { 42 deps += [ "//build/lite/config/component/cJSON:cjson_static" ] 43 } else { 44 deps += [ "//third_party/cJSON:cjson_static" ] 45 } 46 47 subsystem_name = "developtools" 48 part_name = "syscap_codec" 49} 50 51ohos_executable("syscap_tool_test") { 52 install_enable = true 53 include_dirs = [ "src" ] 54 public_configs = [ ":pubilc" ] 55 defines = [] 56 57 if (is_mingw) { 58 defines += [ "_POSIX_" ] 59 } 60 61 sources = [ "./test/syscap_tool_test.c" ] 62 sources += sources_platform_common 63 64 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 65 66 if (defined(ohos_lite)) { 67 deps += [ "//build/lite/config/component/cJSON:cjson_static" ] 68 } else { 69 deps += [ "//third_party/cJSON:cjson_static" ] 70 } 71 72 subsystem_name = "developtools" 73 part_name = "syscap_codec" 74} 75 76ohos_shared_library("syscap_tool_shared") { 77 output_name = "syscap_codec" 78 include_dirs = [ "src" ] 79 public_configs = [ ":pubilc" ] 80 81 sources = sources_platform_common 82 83 deps = [ "//third_party/bounds_checking_function:libsec_static" ] 84 85 if (defined(ohos_lite)) { 86 deps += [ "//build/lite/config/component/cJSON:cjson_static" ] 87 } else { 88 deps += [ "//third_party/cJSON:cjson_static" ] 89 } 90 91 subsystem_name = "developtools" 92 part_name = "syscap_codec" 93} 94 95group("syscap_codec") { 96 deps = [ ":syscap_tool_shared" ] 97} 98