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/iwtp.h", 42 "$target_gen_dir/ejdb2/iowow/iwutils.h", 43 "$target_gen_dir/ejdb2/iowow/iwuuid.h", 44 "$target_gen_dir/ejdb2/iowow/iwxstr.h", 45 "$target_gen_dir/ejdb2/iowow/murmur3.h", 46 ] 47 args = [ 48 "--src-dir", 49 rebase_path(iowow_src_dir), 50 "--dst-dir", 51 rebase_path("$target_gen_dir/ejdb2/iowow"), 52 ] 53} 54 55config("ejdb_public_config") { 56 include_dirs = [ 57 "src", 58 "src/jbi", 59 "src/jbl", 60 "src/jql", 61 "src/util", 62 "$target_gen_dir", 63 ] 64} 65 66config("ejdb_config") { 67 include_dirs = [ 68 "src", 69 "src/jbi", 70 "src/jbl", 71 "src/jql", 72 "src/util", 73 "$target_gen_dir", 74 ] 75 76 cflags = [ 77 "-DNDEBUG", 78 "-O3", 79 "-Wall", 80 "-Wextra", 81 "-Wfatal-errors", 82 "-Wno-implicit-fallthrough", 83 "-Wno-missing-braces", 84 "-Wno-missing-field-initializers", 85 "-Wno-shorten-64-to-32", 86 "-Wno-sign-compare", 87 "-Wno-unknown-pragmas", 88 "-Wno-unused-function", 89 "-Wno-unused-parameter", 90 "-fPIC", 91 "-fsigned-char", 92 "-pedantic", 93 "-std=gnu11", 94 ] 95 96 defines = [ 97 "IW_64", 98 "IW_API_EXPORTS", 99 100 #"JB_HAVE_QSORT_R", 101 "JB_PTHREADS", 102 "_DEFAULT_SOURCE", 103 "_FILE_OFFSET_BITS=64", 104 "_LARGEFILE_SOURCE", 105 "_XOPEN_SOURCE=600", 106 ] 107} 108 109ohos_shared_library("ejdb") { 110 configs = [ ":ejdb_config" ] 111 112 public_configs = [ ":ejdb_public_config" ] 113 114 sources = [ 115 "src/ejdb2.c", 116 "src/jbi/jbi_consumer.c", 117 "src/jbi/jbi_dup_scanner.c", 118 "src/jbi/jbi_full_scanner.c", 119 "src/jbi/jbi_pk_scanner.c", 120 "src/jbi/jbi_selection.c", 121 "src/jbi/jbi_sorter_consumer.c", 122 "src/jbi/jbi_uniq_scanner.c", 123 "src/jbi/jbi_util.c", 124 "src/jbl/binn.c", 125 "src/jbl/jbl.c", 126 "src/jbl/jbl_json.c", 127 "src/jql/jql.c", 128 "src/jql/jqp.c", 129 "src/util/lwre.c", 130 "src/util/utf8proc.c", 131 ] 132 133 deps = [ 134 ":copy_iowow_header", 135 "//third_party/iowow:iowow", 136 ] 137 138 part_name = "hiview" 139 subsystem_name = "hiviewdfx" 140} 141