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