From b233c9e89ba2b5a0661f760edc2f4ca7ecc07669 Mon Sep 17 00:00:00 2001 From: zhuofan0129 <861080528@qq.com> Date: Sat, 3 Aug 2024 15:57:32 +0800 Subject: [PATCH] feat: improve BUILD.gn Signed-off-by: zhuofan0129 <861080528@qq.com> --- common/dslm.gni | 4 ++++ oem_property/common/BUILD.gn | 6 ++++-- oem_property/ohos/standard/BUILD.gn | 18 ++++++++++++++---- services/sa/BUILD.gn | 3 --- 4 files changed, 22 insertions(+), 9 deletions(-) mode change 100644 => 100755 common/dslm.gni mode change 100644 => 100755 oem_property/common/BUILD.gn mode change 100644 => 100755 oem_property/ohos/standard/BUILD.gn mode change 100644 => 100755 services/sa/BUILD.gn diff --git a/common/dslm.gni b/common/dslm.gni old mode 100644 new mode 100755 index 242a5d6..a1736be --- a/common/dslm.gni +++ b/common/dslm.gni @@ -19,3 +19,7 @@ declare_args() { dslm_samgr_path = "//foundation/systemabilitymgr" dslm_lite_component_path = "//build/lite/config/component" } + +declare_args() { + device_security_level_feature_plugin_path = "" +} \ No newline at end of file diff --git a/oem_property/common/BUILD.gn b/oem_property/common/BUILD.gn old mode 100644 new mode 100755 index 184f1b0..c02d6f7 --- a/oem_property/common/BUILD.gn +++ b/oem_property/common/BUILD.gn @@ -14,8 +14,9 @@ import("//base/security/device_security_level/common/dslm.gni") import("//build/ohos.gni") -# oem_common_obj object -ohos_source_set("oem_common_obj") { +if (device_security_level_feature_plugin_path == "") { + # oem_common_obj object + ohos_source_set("oem_common_obj") { sources = [ "dslm_credential.c", "dslm_credential_utils.c", @@ -60,4 +61,5 @@ ohos_source_set("oem_common_obj") { part_name = "device_security_level" subsystem_name = "security" + } } diff --git a/oem_property/ohos/standard/BUILD.gn b/oem_property/ohos/standard/BUILD.gn old mode 100644 new mode 100755 index d5e4acf..99df984 --- a/oem_property/ohos/standard/BUILD.gn +++ b/oem_property/ohos/standard/BUILD.gn @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//base/security/device_security_level/common/dslm.gni") import("//build/ohos.gni") # sa lib @@ -43,10 +44,19 @@ ohos_source_set("dslm_ohos_cred_obj") { "../../../services/include", ] - deps = [ - "../../../baselib/utils:utils_static", - "../../common:oem_common_obj", - ] + deps = [ "../../../baselib/utils:utils_static" ] + + if (device_security_level_feature_plugin_path != "") { + sources += [ "../../common/dslm_credential.c" ] + + include_dirs += [ + "../../common/include", + "../../interfaces/inner_api/include", + "../include", + ] + } else { + deps += [ "../../common:oem_common_obj" ] + } configs = [ "../../../common:common_configs" ] diff --git a/services/sa/BUILD.gn b/services/sa/BUILD.gn old mode 100644 new mode 100755 index 9052266..19c2afc --- a/services/sa/BUILD.gn +++ b/services/sa/BUILD.gn @@ -142,9 +142,6 @@ if (defined(ohos_lite)) { config("dslm_service_config") { include_dirs = [ "../../oem_property/include" ] } - declare_args() { - device_security_level_feature_plugin_path = "" - } ohos_shared_library("dslm_service") { shlib_type = "sa" version_script = "dslm.versionscript" -- Gitee