diff --git a/BUILD.gn b/BUILD.gn index 24bd61d772822da6cbbd891acd5ad17169b32556..4fbfa4f3862979777bd05f4a2ee9c3b4340c625f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,8 +11,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//base/customization/config_policy/config_policy.gni") + group("config_policy_components") { - if (os_level == "standard") { + if (os_level == "standard" && support_config_policy_napi) { deps = [ "//base/customization/config_policy/frameworks/config_policy:configpolicy_util", "//base/customization/config_policy/interfaces/kits/js:configpolicy", diff --git a/config_policy.gni b/config_policy.gni new file mode 100644 index 0000000000000000000000000000000000000000..c4a6a69d336d155a901fb1a697dc5d7c45ff9b3c --- /dev/null +++ b/config_policy.gni @@ -0,0 +1,20 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + # if fs has prefix before OH path, set it here + config_policy_fs_prefix = "" + + # Whether support napi so + support_config_policy_napi = true +} diff --git a/frameworks/config_policy/BUILD.gn b/frameworks/config_policy/BUILD.gn index ceec14c98c71657c2b9cb925934c72461c1cb32f..96ed15142544a9172a51a821a087c2ded27d9938 100644 --- a/frameworks/config_policy/BUILD.gn +++ b/frameworks/config_policy/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,17 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//base/customization/config_policy/config_policy.gni") if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { import("//build/ohos.gni") } -declare_args() { - # if fs has prefix before OH path, set it here - config_policy_fs_prefix = "" -} - config_policy_sources = [ "src/config_policy_utils.c" ] config("config_policy_config") { include_dirs = [