BUILD.gn 3.6 KB
Newer Older
C
code4lala 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# Copyright (C) 2021 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.

import("//test/xts/acts/security_lite/deviceauth_basic_deps/deviceauth.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")

hctest_suite("ActsSecurityHichainBasicDeps") {
  suite_name = "acts"

  sources = [ "test.c" ]

  sources += DEVICEAUTH_BASIC_DEPS_SOURCE

  include_dirs = [
    "//utils/native/base/include",
    "//utils/native/lite/include",
    "//test/xts/tools/lite/hctest/include",
    "//third_party/unity/src",
    "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
  ]

  include_dirs += DEVICEAUTH_BASIC_DEPS_INC

  deps = []

  cflags = [ "-Werror" ]

  ldflags = [
    "-lstdc++",
    "-lm",
    "-lpthread",
  ]

  defines = [
    "MKDIR_IMPLEMENTED=0",
    "STAT_IMPLEMENTED=0",
    "ACCESS_IMPLEMENTED=0",
    "F_API_IMPLEMENTED=0",
    "FLASH_START_ADDRESS_HICHAIN=0",
    "UTILS_FILE_IMPLEMENTED=1",
    "TEST_PTHREAD_CREATE_DETACHED=0",
    "TEST_HC_FILE_OPEN_SERIES=1",
C
code4lala 已提交
53 54 55 56 57 58 59 60 61

    "TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
    "TEST_IMPORT_ASYMMETRIC_KEY=1",
    "TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=1",
    "TEST_HASH_TO_POINT=1",
    "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
    "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
    "TEST_AGREE_SHARED_SECRET=1",
    "TEST_BIG_NUM_EXP_MOD=1",
C
code4lala 已提交
62 63 64
  ]

  if (defined(ohos_lite)) {
C
code4lala 已提交
65 66 67
    include_dirs += [
      "//base/security/deviceauth/deps_adapter/os_adapter/interfaces/liteos",
    ]
C
code4lala 已提交
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
    if (ohos_kernel_type == "liteos_m") {
      # liteos m
      include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ]
      deps +=
          [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
      if (board_name == "rtl8720") {
        cflags +=
            [ "-isystem${ohos_root_path}/kernel/liteos_m/kal/posix/include" ]
        defines -= [
          "FLASH_START_ADDRESS_HICHAIN=0",
          "TEST_HC_FILE_OPEN_SERIES=1",
        ]
        defines += [
          "FLASH_START_ADDRESS_HICHAIN=0x1F6000",
          "TEST_HC_FILE_OPEN_SERIES=0",
        ]
      }
      if (board_name == "hispark_pegasus") {
        # 3861
C
code4lala 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
        defines -= [
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
          "TEST_HASH_TO_POINT=1",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET=1",
          "TEST_BIG_NUM_EXP_MOD=1",
        ]
        defines += [
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=0",
          "TEST_HASH_TO_POINT=0",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET=0",
          "TEST_BIG_NUM_EXP_MOD=0",
        ]
C
code4lala 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
      }
    } else {
      #liteos a or L1 linux
      include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ]
      deps +=
          [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
    }
  } else {
    # linux
    include_dirs += [
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",

      "//base/security/deviceauth/deps_adapter/os_adapter/interfaces/linux",
    ]
    deps += [
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
    ]
  }
}