1d066c7e5Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd. 2d066c7e5Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3d066c7e5Sopenharmony_ci# you may not use this file except in compliance with the License. 4d066c7e5Sopenharmony_ci# You may obtain a copy of the License at 5d066c7e5Sopenharmony_ci# 6d066c7e5Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7d066c7e5Sopenharmony_ci# 8d066c7e5Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9d066c7e5Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10d066c7e5Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11d066c7e5Sopenharmony_ci# See the License for the specific language governing permissions and 12d066c7e5Sopenharmony_ci# limitations under the License. 13d066c7e5Sopenharmony_ci 14d066c7e5Sopenharmony_ciimport("//build/ohos.gni") 15d066c7e5Sopenharmony_ci 16d066c7e5Sopenharmony_ciohos_shared_library("cj_config_policy_ffi") { 17d066c7e5Sopenharmony_ci include_dirs = [ 18d066c7e5Sopenharmony_ci "include", 19d066c7e5Sopenharmony_ci "../../../interfaces/inner_api/include", 20d066c7e5Sopenharmony_ci "../../../frameworks/dfx/hisysevent_adapter", 21d066c7e5Sopenharmony_ci ] 22d066c7e5Sopenharmony_ci if (!defined(defines)) { 23d066c7e5Sopenharmony_ci defines = [] 24d066c7e5Sopenharmony_ci } 25d066c7e5Sopenharmony_ci 26d066c7e5Sopenharmony_ci if (product_name != "ohos-sdk") { 27d066c7e5Sopenharmony_ci deps = [ "../../../frameworks/config_policy:configpolicy_util" ] 28d066c7e5Sopenharmony_ci external_deps = [ 29d066c7e5Sopenharmony_ci "bounds_checking_function:libsec_shared", 30d066c7e5Sopenharmony_ci "c_utils:utils", 31d066c7e5Sopenharmony_ci "hilog:libhilog", 32d066c7e5Sopenharmony_ci "hisysevent:libhisysevent", 33d066c7e5Sopenharmony_ci "napi:cj_bind_ffi", 34d066c7e5Sopenharmony_ci "napi:cj_bind_native", 35d066c7e5Sopenharmony_ci ] 36d066c7e5Sopenharmony_ci sources = [ 37d066c7e5Sopenharmony_ci "../../../frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp", 38d066c7e5Sopenharmony_ci "src/config_policy_ffi.cpp", 39d066c7e5Sopenharmony_ci ] 40d066c7e5Sopenharmony_ci } else { 41d066c7e5Sopenharmony_ci defines += [ "PREVIEWER" ] 42d066c7e5Sopenharmony_ci sources = [ "src/config_policy_mock.cpp" ] 43d066c7e5Sopenharmony_ci } 44d066c7e5Sopenharmony_ci 45d066c7e5Sopenharmony_ci if (current_os == "ohos") { 46d066c7e5Sopenharmony_ci defines += [ "OHOS_PLATFORM" ] 47d066c7e5Sopenharmony_ci } 48d066c7e5Sopenharmony_ci 49d066c7e5Sopenharmony_ci if (current_os == "mingw") { 50d066c7e5Sopenharmony_ci defines += [ "WINDOWS_PLATFORM" ] 51d066c7e5Sopenharmony_ci } 52d066c7e5Sopenharmony_ci innerapi_tags = [ "platformsdk" ] 53d066c7e5Sopenharmony_ci subsystem_name = "customization" 54d066c7e5Sopenharmony_ci part_name = "config_policy" 55d066c7e5Sopenharmony_ci} 56