• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#Copyright (c) 2019-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("//build/ohos.gni")
15
16iowow_src_dir = "//third_party/iowow/src"
17action("copy_iowow_header") {
18  visibility = [ ":*" ]
19  script = "copy_iowow_header.py"
20  inputs = []
21  outputs = [
22    "$target_gen_dir/ejdb2/iowow/basedefs.h",
23    "$target_gen_dir/ejdb2/iowow/iowow.h",
24    "$target_gen_dir/ejdb2/iowow/iwarr.h",
25    "$target_gen_dir/ejdb2/iowow/iwbinn.h",
26    "$target_gen_dir/ejdb2/iowow/iwbits.h",
27    "$target_gen_dir/ejdb2/iowow/iwconv.h",
28    "$target_gen_dir/ejdb2/iowow/iwdlsnr.h",
29    "$target_gen_dir/ejdb2/iowow/iwexfile.h",
30    "$target_gen_dir/ejdb2/iowow/iwfile.h",
31    "$target_gen_dir/ejdb2/iowow/iwfsmfile.h",
32    "$target_gen_dir/ejdb2/iowow/iwhmap.h",
33    "$target_gen_dir/ejdb2/iowow/iwjson_internal.h",
34    "$target_gen_dir/ejdb2/iowow/iwjson.h",
35    "$target_gen_dir/ejdb2/iowow/iwkv.h",
36    "$target_gen_dir/ejdb2/iowow/iwlog.h",
37    "$target_gen_dir/ejdb2/iowow/iwp.h",
38    "$target_gen_dir/ejdb2/iowow/iwpool.h",
39    "$target_gen_dir/ejdb2/iowow/iwrdb.h",
40    "$target_gen_dir/ejdb2/iowow/iwre.h",
41    "$target_gen_dir/ejdb2/iowow/iwsha2.h",
42    "$target_gen_dir/ejdb2/iowow/iwstree.h",
43    "$target_gen_dir/ejdb2/iowow/iwstw.h",
44    "$target_gen_dir/ejdb2/iowow/iwth.h",
45    "$target_gen_dir/ejdb2/iowow/iwutils.h",
46    "$target_gen_dir/ejdb2/iowow/iwuuid.h",
47    "$target_gen_dir/ejdb2/iowow/iwxstr.h",
48    "$target_gen_dir/ejdb2/iowow/murmur3.h",
49    "$target_gen_dir/ejdb2/iowow/utf8proc.h",
50  ]
51  args = [
52    "--src-dir",
53    rebase_path(iowow_src_dir),
54    "--dst-dir",
55    rebase_path("$target_gen_dir/ejdb2/iowow"),
56  ]
57}
58
59config("ejdb_public_config") {
60  include_dirs = [
61    "$target_gen_dir",
62    "$target_gen_dir/ejdb2",
63    "src",
64    "src/jbi",
65    "src/jql",
66    "src/util",
67  ]
68}
69
70config("ejdb_config") {
71  include_dirs = [
72    "$target_gen_dir",
73    "$target_gen_dir/ejdb2",
74    "src",
75    "src/jbi",
76    "src/jql",
77    "src/util",
78  ]
79
80  cflags = [
81    "-DNDEBUG",
82    "-O3",
83    "-Wall",
84    "-Wextra",
85    "-Wfatal-errors",
86    "-Wno-gnu-statement-expression",
87    "-Wno-implicit-fallthrough",
88    "-Wno-missing-braces",
89    "-Wno-missing-field-initializers",
90    "-Wno-shorten-64-to-32",
91    "-Wno-sign-compare",
92    "-Wno-unknown-pragmas",
93    "-Wno-unused-function",
94    "-Wno-unused-parameter",
95    "-fPIC",
96    "-fsigned-char",
97    "-pedantic",
98    "-std=gnu11",
99    "-Wno-unused-but-set-variable",
100    "-Wno-strict-prototypes",
101  ]
102
103  defines = [
104    "IW_64",
105    "IW_API_EXPORTS",
106    "JB_PTHREADS",
107    "_DEFAULT_SOURCE",
108    "_FILE_OFFSET_BITS=64",
109    "_LARGEFILE_SOURCE",
110    "_XOPEN_SOURCE=600",
111  ]
112}
113
114ohos_shared_library("ejdb") {
115  configs = [ ":ejdb_config" ]
116
117  public_configs = [ ":ejdb_public_config" ]
118
119  sources = [
120    "src/ejdb2.c",
121    "src/jbi/jbi_consumer.c",
122    "src/jbi/jbi_dup_scanner.c",
123    "src/jbi/jbi_full_scanner.c",
124    "src/jbi/jbi_pk_scanner.c",
125    "src/jbi/jbi_selection.c",
126    "src/jbi/jbi_sorter_consumer.c",
127    "src/jbi/jbi_uniq_scanner.c",
128    "src/jbi/jbi_util.c",
129    "src/jql/jql.c",
130    "src/jql/jqp.c",
131  ]
132
133  deps = [
134    ":copy_iowow_header",
135    "//third_party/iowow:iowow",
136  ]
137  version_script = "libejdb.map"
138  innerapi_tags = [ "platformsdk" ]
139  part_name = "ejdb"
140  subsystem_name = "thirdparty"
141}
142
143ohos_static_library("ejdb_static_lib_for_tdd") {
144  configs = [ ":ejdb_config" ]
145
146  public_configs = [ ":ejdb_public_config" ]
147
148  sources = [
149    "src/ejdb2.c",
150    "src/jbi/jbi_consumer.c",
151    "src/jbi/jbi_dup_scanner.c",
152    "src/jbi/jbi_full_scanner.c",
153    "src/jbi/jbi_pk_scanner.c",
154    "src/jbi/jbi_selection.c",
155    "src/jbi/jbi_sorter_consumer.c",
156    "src/jbi/jbi_uniq_scanner.c",
157    "src/jbi/jbi_util.c",
158    "src/jql/jql.c",
159    "src/jql/jqp.c",
160  ]
161
162  deps = [
163    ":copy_iowow_header",
164    "//third_party/iowow:iowow",
165  ]
166  part_name = "ejdb"
167  subsystem_name = "thirdparty"
168}
169