|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +exc = executable( |
| 19 | + 'arrow-feather-test', |
| 20 | + sources: ['feather_test.cc'], |
| 21 | + dependencies: [arrow_ipc_deps, arrow_test_dep], |
| 22 | +) |
| 23 | +test('arrow-feather-test', exc) |
| 24 | + |
| 25 | +ipc_tests = [ |
| 26 | + 'json_simple_test', |
| 27 | + 'message_internal_test', |
| 28 | + 'read_write_test', |
| 29 | + 'tensor_test', |
| 30 | +] |
| 31 | + |
| 32 | +foreach ipc_test : ipc_tests |
| 33 | + test_name = 'arrow-ipc-@0@'.format(ipc_test.replace('_', '-')) |
| 34 | + exc = executable( |
| 35 | + test_name, |
| 36 | + sources: [ '@[email protected]'.format(ipc_test)], |
| 37 | + dependencies: [arrow_ipc_deps, arrow_test_dep], |
| 38 | + ) |
| 39 | + test(test_name, exc) |
| 40 | +endforeach |
| 41 | + |
| 42 | +install_headers( |
| 43 | + [ |
| 44 | + 'api.h', |
| 45 | + 'dictionary.h', |
| 46 | + 'feather.h', |
| 47 | + 'json_simple.h', |
| 48 | + 'message.h', |
| 49 | + 'options.h', |
| 50 | + 'reader.h', |
| 51 | + 'test_common.h', |
| 52 | + 'type_fwd.h', |
| 53 | + 'util.h', |
| 54 | + 'writer.h', |
| 55 | + ], |
| 56 | + subdir: 'arrow/ipc', |
| 57 | +) |
| 58 | + |
| 59 | +if needs_utilities or needs_integration |
| 60 | + file_to_stream_exc = executable( |
| 61 | + 'arrow-file-to-stream', |
| 62 | + sources: ['file_to_stream.cc'], |
| 63 | + dependencies: [arrow_dep], |
| 64 | + install: needs_utilities, |
| 65 | + ) |
| 66 | + |
| 67 | + stream_to_file_exc = executable( |
| 68 | + 'arrow-stream-to-file', |
| 69 | + sources: ['stream_to_file.cc'], |
| 70 | + dependencies: [arrow_dep], |
| 71 | + install: needs_utilities, |
| 72 | + ) |
| 73 | + |
| 74 | + if needs_integration |
| 75 | + # TODO: The CMake configuration would add these executables |
| 76 | + # to an arrow-integration target, which is in turn |
| 77 | + # used by arrow-all. The targets are modified, but not |
| 78 | + # used within Arrow C++ (?) - do we need to replicate that here? |
| 79 | + endif |
| 80 | +endif |
| 81 | + |
| 82 | +exc = executable( |
| 83 | + 'arrow-ipc-read-write-benchmark', |
| 84 | + sources: ['read_write_benchmark.cc'], |
| 85 | + dependencies: [arrow_benchmark_dep], |
| 86 | +) |
| 87 | +benchmark('arrow-ipc-read-write-benchmark', exc) |
| 88 | + |
| 89 | +if needs_fuzzing or (needs_utilities |
| 90 | +and needs_testing |
| 91 | +and needs_lz4 |
| 92 | +and needs_zstd |
| 93 | +) |
| 94 | + fuzz_corpus_exc = executable( |
| 95 | + 'arrow-ipc-generate-fuzz-corpus', |
| 96 | + sources: ['generate_fuzz_corpus.cc'], |
| 97 | + dependencies: [arrow_test_dep], |
| 98 | + ) |
| 99 | + |
| 100 | + tensor_fuzz_corpus_exc = executable( |
| 101 | + 'arrow-ipc-generate-tensor-fuzz-corpus', |
| 102 | + sources: ['generate_tensor_fuzz_corpus.cc'], |
| 103 | + dependencies: [arrow_test_dep], |
| 104 | + ) |
| 105 | +endif |
| 106 | + |
| 107 | +ipc_fuzz_targets = ['file_fuzz', 'stream_fuzz', 'tensor_stream_fuzz'] |
| 108 | + |
| 109 | +if needs_fuzzing |
| 110 | + if meson.version() < '1.8.0' |
| 111 | + error( |
| 112 | + ' Meson >= 1.8.0 is required for fuzzing support, found @0@'.format( |
| 113 | + meson.version(), |
| 114 | + ), |
| 115 | + ) |
| 116 | + endif |
| 117 | + |
| 118 | + foreach ipc_fuzz_target : ipc_fuzz_targets |
| 119 | + target_name = 'arrow-ipc-@0@'.format(ipc_fuzz_target.replace('_', '-')) |
| 120 | + executable( |
| 121 | + target_name, |
| 122 | + sources: [ '@[email protected]'.format(ipc_fuzz_target)], |
| 123 | + dependencies: [arrow_dep], |
| 124 | + override_options: ['-Db_sanitize=fuzzer'], |
| 125 | + ) |
| 126 | + endforeach |
| 127 | +endif |
0 commit comments