• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
2
3declare_args() {
4  qrcodegen_feature_ace_engine_qrcode_able = true
5}
6
7if (defined(ohos_lite)) {
8  import("//build/lite/config/component/lite_component.gni")
9} else {
10  import("//build/ohos.gni")
11}
12
13config("libqrcodegen_config") {
14  include_dirs = [ "cpp" ]
15}
16
17config("qrcodegen_config") {
18  cflags = [
19    "-Wall",
20    "-fexceptions",
21  ]
22  cflags_cc = cflags
23}
24
25if (defined(ohos_lite)) {
26  lite_library("qrcodegen") {
27    if (ohos_kernel_type == "liteos_m") {
28      target_type = "static_library"
29    } else {
30      target_type = "shared_library"
31    }
32    sources = [ "cpp/qrcodegen.cpp" ]
33    include_dirs = [ "//third_party/qrcodegen/cpp" ]
34    if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
35      cflags = [
36        "--diag_suppress",
37        "Pe366",
38      ]
39      cflags_cc = cflags
40    } else {
41      cflags = [ "-Wall" ]
42      cflags_cc = cflags
43    }
44    public_configs = [ ":libqrcodegen_config" ]
45  }
46
47  lite_component("qrcode") {
48    features = [ ":qrcodegen" ]
49  }
50} else {
51  ohos_static_library("qrcodegen_static") {
52    sources = [ "cpp/qrcodegen.cpp" ]
53    include_dirs = [ "//third_party/qrcodegen/cpp" ]
54    configs = [ ":qrcodegen_config" ]
55    public_configs = [ ":libqrcodegen_config" ]
56  }
57  if (qrcodegen_feature_ace_engine_qrcode_able) {
58    config("ace_engine_qrcode_config") {
59      include_dirs = [ "//third_party/qrcodegen/cpp" ]
60      defines = [ "ACE_ENGINE_QRCODE_ABLE" ]
61      cflags = [
62        "-Wall",
63        "-Wno-reorder",
64      ]
65      cflags_cc = cflags
66    }
67
68    ohos_static_library("ace_engine_qrcode") {
69      sources = [ "cpp/qrcodegen.cpp" ]
70      public_configs = [ ":ace_engine_qrcode_config" ]
71      subsystem_name = "thirdparty"
72      part_name = "qrcodegen"
73    }
74  }
75}
76