• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//foundation/communication/dsoftbus/dsoftbus.gni")
15AUTH_SERVER_DEFINES = []
16if (dsoftbus_feature_auth_account == true) {
17  AUTH_SERVER_DEFINES += [ "AUTH_ACCOUNT" ]
18}
19
20authentication_path = "$dsoftbus_root_path/core/authentication"
21native_source_path = rebase_path("$dsoftbus_root_path")
22auth_dir = "dsoftbus_enhance/core/authentication/src"
23enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
24                       [
25                         "$native_source_path",
26                         "$auth_dir",
27                       ],
28                       "value")
29
30if (dsoftbus_feature_lnn_net) {
31  auth_server_src = [
32    "$authentication_path/src/auth_common.c",
33    "$authentication_path/src/auth_connection.c",
34    "$authentication_path/src/auth_hichain.c",
35    "$authentication_path/src/auth_manager.c",
36    "$authentication_path/src/auth_request.c",
37    "$authentication_path/src/auth_session_fsm.c",
38    "$authentication_path/src/auth_session_key.c",
39    "$authentication_path/src/auth_session_message.c",
40    "$authentication_path/src/auth_interface.c",
41  ]
42  if (enhanced) {
43    auth_server_src += [ "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/src/auth_meta_manager.c" ]
44  } else {
45    auth_server_src +=
46        [ "$authentication_path/src/virtual/auth_meta_manager_virtual.c" ]
47  }
48  if (dsoftbus_feature_ip_auth) {
49    auth_server_src +=
50        [ "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c" ]
51  } else {
52    auth_server_src += [ "$dsoftbus_root_path/core/authentication/src/virtual/auth_tcp_connection_virtual.c" ]
53  }
54} else {
55  auth_server_src = [
56    "$authentication_path/src/virtual/auth_interface_virtual.c",
57    "$authentication_path/src/virtual/auth_tcp_connection_virtual.c",
58    "$authentication_path/src/virtual/auth_meta_manager_virtual.c",
59  ]
60}
61auth_server_inc = [
62  "$dsoftbus_root_path/core/authentication/include",
63  "$dsoftbus_root_path/core/authentication/interface",
64]
65auth_server_deps = []
66
67if (defined(ohos_lite)) {
68  if (ohos_kernel_type == "liteos_m") {
69    auth_server_inc += [ "//base/security/device_auth/interfaces/innerkits" ]
70    if (dsoftbus_feature_lnn_net) {
71      auth_server_deps += [ "//base/security/device_auth/services:deviceauth" ]
72    }
73  } else {
74    auth_server_inc += [ "//third_party/cJSON" ]
75    if (dsoftbus_feature_lnn_net) {
76      auth_server_deps +=
77          [ "//base/security/device_auth/services:deviceauth_sdk" ]
78    }
79  }
80} else {
81  auth_server_inc += [ "//base/security/device_auth/interfaces/innerkits" ]
82}
83