1# Copyright (c) 2024 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 16ohos_shared_library("cj_config_policy_ffi") { 17 include_dirs = [ 18 "include", 19 "../../../interfaces/inner_api/include", 20 "../../../frameworks/dfx/hisysevent_adapter", 21 ] 22 if (!defined(defines)) { 23 defines = [] 24 } 25 26 if (product_name != "ohos-sdk") { 27 deps = [ "../../../frameworks/config_policy:configpolicy_util" ] 28 external_deps = [ 29 "bounds_checking_function:libsec_shared", 30 "c_utils:utils", 31 "hilog:libhilog", 32 "hisysevent:libhisysevent", 33 "napi:cj_bind_ffi", 34 "napi:cj_bind_native", 35 ] 36 sources = [ 37 "../../../frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp", 38 "src/config_policy_ffi.cpp", 39 ] 40 } else { 41 defines += [ "PREVIEWER" ] 42 sources = [ "src/config_policy_mock.cpp" ] 43 } 44 45 if (current_os == "ohos") { 46 defines += [ "OHOS_PLATFORM" ] 47 } 48 49 if (current_os == "mingw") { 50 defines += [ "WINDOWS_PLATFORM" ] 51 } 52 innerapi_tags = [ "platformsdk" ] 53 subsystem_name = "customization" 54 part_name = "config_policy" 55} 56