From 152a5d98279d5d0596bb0d446db8f0853e43ba1a Mon Sep 17 00:00:00 2001 From: huangke11 Date: Tue, 10 Jan 2023 16:55:30 +0800 Subject: [PATCH] add compile args Signed-off-by: huangke11 --- BUILD.gn | 6 ++++-- config_policy.gni | 20 ++++++++++++++++++++ frameworks/config_policy/BUILD.gn | 8 ++------ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 config_policy.gni diff --git a/BUILD.gn b/BUILD.gn index 24bd61d..4fbfa4f 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 0000000..c4a6a69 --- /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 ceec14c..96ed151 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 = [ -- Gitee