|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# Description: |
| 16 | +# Apache arrow library |
| 17 | + |
| 18 | +load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 19 | + |
| 20 | +flatbuffer_cc_library( |
| 21 | + name = "arrow_format", |
| 22 | + srcs = [ |
| 23 | + "cpp/src/arrow/ipc/feather.fbs", |
| 24 | + "format/File.fbs", |
| 25 | + "format/Message.fbs", |
| 26 | + "format/Schema.fbs", |
| 27 | + "format/SparseTensor.fbs", |
| 28 | + "format/Tensor.fbs", |
| 29 | + ], |
| 30 | + flatc_args = [ |
| 31 | + "--scoped-enums", |
| 32 | + "--gen-object-api", |
| 33 | + ], |
| 34 | + out_prefix = "cpp/src/generated/", |
| 35 | +) |
| 36 | + |
| 37 | +package(default_visibility = ["//visibility:public"]) |
| 38 | + |
| 39 | +genrule( |
| 40 | + name = "arrow_util_config", |
| 41 | + srcs = ["cpp/src/arrow/util/config.h.cmake"], |
| 42 | + outs = ["cpp/src/arrow/util/config.h"], |
| 43 | + cmd = ("sed " + |
| 44 | + "-e 's/@ARROW_VERSION_MAJOR@/0/g' " + |
| 45 | + "-e 's/@ARROW_VERSION_MINOR@/16/g' " + |
| 46 | + "-e 's/@ARROW_VERSION_PATCH@/0/g' " + |
| 47 | + "-e 's/cmakedefine/define/g' " + |
| 48 | + "$< >$@"), |
| 49 | +) |
| 50 | + |
| 51 | +# LINT.IfChange(parquet_gen_version) |
| 52 | +genrule( |
| 53 | + name = "parquet_version_h", |
| 54 | + srcs = ["cpp/src/parquet/parquet_version.h.in"], |
| 55 | + outs = ["cpp/src/parquet/parquet_version.h"], |
| 56 | + cmd = ("sed " + |
| 57 | + "-e 's/@PARQUET_VERSION_MAJOR@/1/g' " + |
| 58 | + "-e 's/@PARQUET_VERSION_MINOR@/5/g' " + |
| 59 | + "-e 's/@PARQUET_VERSION_PATCH@/1/g' " + |
| 60 | + "$< >$@"), |
| 61 | +) |
| 62 | +# LINT.ThenChange(../WORKSPACE:arrow_archive_version) |
| 63 | + |
| 64 | +cc_library( |
| 65 | + name = "arrow", |
| 66 | + srcs = glob( |
| 67 | + [ |
| 68 | + "cpp/src/arrow/*.cc", |
| 69 | + "cpp/src/arrow/array/*.cc", |
| 70 | + "cpp/src/arrow/csv/*.cc", |
| 71 | + "cpp/src/arrow/io/*.cc", |
| 72 | + "cpp/src/arrow/util/*.cc", |
| 73 | + "cpp/src/arrow/util/compression_snappy.h", |
| 74 | + "cpp/src/arrow/util/compression_snappy.cc", |
| 75 | + "cpp/src/arrow/compute/**/*.cc", |
| 76 | + "cpp/src/arrow/compute/**/*.h", |
| 77 | + "cpp/src/arrow/vendored/optional.hpp", |
| 78 | + "cpp/src/arrow/vendored/string_view.hpp", |
| 79 | + "cpp/src/arrow/vendored/variant.hpp", |
| 80 | + "cpp/src/arrow/vendored/**/*.cpp", |
| 81 | + "cpp/src/arrow/vendored/**/*.hpp", |
| 82 | + "cpp/src/arrow/vendored/**/*.cc", |
| 83 | + "cpp/src/arrow/vendored/**/*.c", |
| 84 | + "cpp/src/arrow/vendored/**/*.h", |
| 85 | + "cpp/src/arrow/ipc/*.cc", |
| 86 | + "cpp/src/arrow/ipc/*.h", |
| 87 | + "cpp/src/arrow/**/*.h", |
| 88 | + "cpp/src/parquet/**/*.h", |
| 89 | + "cpp/src/parquet/**/*.cc", |
| 90 | + ], |
| 91 | + exclude = [ |
| 92 | + "cpp/src/arrow/util/compression_brotli*", |
| 93 | + "cpp/src/arrow/util/compression_bz2*", |
| 94 | + "cpp/src/arrow/util/compression_lz4*", |
| 95 | + "cpp/src/arrow/util/compression_z*", |
| 96 | + "cpp/src/**/*_benchmark.cc", |
| 97 | + "cpp/src/**/*_main.cc", |
| 98 | + "cpp/src/**/*_nossl.cc", |
| 99 | + "cpp/src/**/*_test.cc", |
| 100 | + "cpp/src/**/*-test.cc", |
| 101 | + "cpp/src/**/test_*.cc", |
| 102 | + "cpp/src/**/*hdfs*.cc", |
| 103 | + "cpp/src/**/*fuzz*.cc", |
| 104 | + "cpp/src/**/file_to_stream.cc", |
| 105 | + "cpp/src/**/stream_to_file.cc", |
| 106 | + "cpp/src/arrow/ipc/json*.cc", |
| 107 | + "cpp/src/arrow/vendored/xxhash/**", |
| 108 | + ], |
| 109 | + ) + [ |
| 110 | + "@struct2tensor//third_party:parquet/parquet_types.cpp", |
| 111 | + ], |
| 112 | + hdrs = [ |
| 113 | + # declare header from above genrule |
| 114 | + "cpp/src/arrow/util/config.h", |
| 115 | + "cpp/src/parquet/parquet_version.h", |
| 116 | + ], |
| 117 | + defines = [ |
| 118 | + # LINT.IfChange |
| 119 | + "ARROW_WITH_SNAPPY", |
| 120 | + # LINT.ThenChange(../WORKSPACE:snappy_archive_version) |
| 121 | + ], |
| 122 | + includes = [ |
| 123 | + "cpp/src", |
| 124 | + "cpp/src/arrow/vendored/xxhash", |
| 125 | + ], |
| 126 | + textual_hdrs = [ |
| 127 | + "cpp/src/arrow/vendored/xxhash/xxhash.c", |
| 128 | + ], |
| 129 | + deps = [ |
| 130 | + ":arrow_format", |
| 131 | + "@snappy", |
| 132 | + "@struct2tensor//third_party:parquet_types_h", |
| 133 | + "@thrift", |
| 134 | + ], |
| 135 | +) |
0 commit comments