1# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
2
3if (defined(ohos_lite)) {
4  import("//build/lite/config/component/lite_component.gni")
5} else {
6  import("//build/ohos.gni")
7}
8
9config("libqrcodegen_config") {
10  include_dirs = [ "cpp" ]
11}
12
13config("qrcodegen_config") {
14  cflags = [
15    "-Wall",
16    "-fexceptions",
17  ]
18  cflags_cc = cflags
19}
20
21if (defined(ohos_lite)) {
22  lite_library("qrcodegen") {
23    if (ohos_kernel_type == "liteos_m") {
24      target_type = "static_library"
25    } else {
26      target_type = "shared_library"
27    }
28    sources = [ "cpp/qrcodegen.cpp" ]
29    include_dirs = [ "//third_party/qrcodegen/cpp" ]
30    if (defined(board_toolchain_type) && board_toolchain_type == "iccarm") {
31      cflags = [
32        "--diag_suppress",
33        "Pe366",
34      ]
35      cflags_cc = cflags
36    } else {
37      cflags = [ "-Wall" ]
38      cflags_cc = cflags
39    }
40    public_configs = [ ":libqrcodegen_config" ]
41  }
42
43  lite_component("qrcode") {
44    features = [ ":qrcodegen" ]
45  }
46} else {
47  ohos_static_library("qrcodegen_static") {
48    sources = [ "cpp/qrcodegen.cpp" ]
49    include_dirs = [ "//third_party/qrcodegen/cpp" ]
50    configs = [ ":qrcodegen_config" ]
51    public_configs = [ ":libqrcodegen_config" ]
52  }
53}
54