diff --git a/services/BUILD.gn b/services/BUILD.gn index 9ac56a36a4352e35a93bf8ba348b041c49a4bdb6..1280c30401b8ef90383474217358fc575d46eacf 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -131,6 +131,7 @@ ohos_shared_library("powermgrservice") { "libxml2:libxml2", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "window_manager:libdm_lite", "window_manager:libwm_lite", ] @@ -166,7 +167,6 @@ ohos_shared_library("powermgrservice") { defines += [ "HAS_DISPLAY_MANAGER" ] external_deps += [ "display_manager:displaymgr", - "window_manager:libdm_lite", ] } diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index ca1905bbf4d975784d67c2089294b2549585dff7..399d57e1656582713861af8e802cd95e1937455f 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -858,7 +858,9 @@ ohos_unittest("test_device_state_action_native") { "${powermgr_service_path}:powermgrservice", ] - deps_ex += [ "display_manager:displaymgr" ] + if (has_display_manager_part) { + deps_ex += [ "display_manager:displaymgr" ] + } deps_ex += [ "window_manager:libdm_lite" ] external_deps = deps_ex } @@ -1698,7 +1700,6 @@ group("unittest") { ":power_mode_module_native_test", ":power_state_machine_native_test", ":test_device_power_action", - ":test_device_state_action_native", ":test_mock_parcel", ":test_mock_peer", ":test_mock_proxy", @@ -1740,6 +1741,9 @@ group("unittest") { ":test_running_lock_scenario", ":test_running_lock_timer_handler", ] + if (has_display_manager_part) { + deps += [ ":test_device_state_action_native" ] + } } group("unittest_ex") {