|
| 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 | +# arrow_install_all_headers |
| 19 | + |
| 20 | +conf_data = configuration_data() |
| 21 | + |
| 22 | +version = meson.project_version() |
| 23 | +# Remove any pre-release / build identifiers |
| 24 | +version_no_pre_release = version.split('-')[0] |
| 25 | +version_no_build = version_no_pre_release.split('+')[0] |
| 26 | +components = version_no_build.split('.') |
| 27 | +assert( |
| 28 | + components.length() >= 3, |
| 29 | + 'The version does not contain major, minor and patch', |
| 30 | +) |
| 31 | +ver_major = components[0] |
| 32 | +ver_minor = components[1] |
| 33 | +ver_patch = components[2] |
| 34 | +conf_data.set('ARROW_VERSION_MAJOR', ver_major) |
| 35 | +conf_data.set('ARROW_VERSION_MINOR', ver_minor) |
| 36 | +conf_data.set('ARROW_VERSION_PATCH', ver_patch) |
| 37 | + |
| 38 | +conf_data.set('ARROW_VERSION_STRING', version) |
| 39 | + |
| 40 | +# conf_data.set('ARROW_SO_VERSION', ...) |
| 41 | +# conf_data.set('ARROW_FULL_SO_VERSION', ...) |
| 42 | + |
| 43 | +# conf_data.set('ARROW_CXX_COMPILER_ID', ...) |
| 44 | +# conf_data.set('ARROW_CXX_COMPILER_VERSION', ...) |
| 45 | +# conf_data.set('ARROW_CXX_COMPILER_FLAGS', ...) |
| 46 | + |
| 47 | +conf_data.set('UPPERCASE_BUILD_TYPE', get_option('buildtype').to_upper()) |
| 48 | + |
| 49 | +# conf_data.set('ARROW_PACKAGE_KIND', ...) |
| 50 | + |
| 51 | +configure_file( |
| 52 | + input: 'config.h.cmake', |
| 53 | + output: 'config.h', |
| 54 | + configuration: conf_data, |
| 55 | + # https://mesonbuild.com/Reference-manual_functions.html#arguments13 |
| 56 | + # TODO: need to bridge #cmakedefines somehow |
| 57 | + format: 'cmake@', |
| 58 | + install: true, |
| 59 | + install_dir: '.', |
| 60 | +) |
| 61 | + |
| 62 | +internal_conf_data = configuration_data() |
| 63 | + |
| 64 | +# internal_conf_data.set('ARROW_GIT_ID', ...) |
| 65 | +# internal_conf_data.set('ARROW_GIT_DESCRIPTION', ...) |
| 66 | + |
| 67 | +configure_file( |
| 68 | + input: 'config_internal.h.cmake', |
| 69 | + output: 'config_internal.h', |
| 70 | + configuration: internal_conf_data, |
| 71 | + # https://mesonbuild.com/Reference-manual_functions.html#arguments13 |
| 72 | + # TODO: need to bridge #cmakedefines somehow |
| 73 | + format: 'cmake@', |
| 74 | + install: true, |
| 75 | + install_dir: '.', |
| 76 | +) |
| 77 | + |
| 78 | +io_util_test_sources = ['io_util_test.cc'] |
| 79 | +if meson.get_compiler('cpp').get_id() == 'msvc' |
| 80 | + io_util_test_sources += ['io_util_test.manifest'] |
| 81 | +elif host_machine.system() == 'windows' |
| 82 | + io_util_test_sources += ['io_util_test.rc'] |
| 83 | +endif |
| 84 | + |
| 85 | +if needs_tests |
| 86 | + util_tests = [ |
| 87 | + 'align_util_test.cc', |
| 88 | + 'atfork_test.cc', |
| 89 | + 'byte_size_test.cc', |
| 90 | + 'byte_stream_split_test.cc', |
| 91 | + 'cache_test.cc', |
| 92 | + 'checked_cast_test.cc', |
| 93 | + 'compression_test.cc', |
| 94 | + 'decimal_test.cc', |
| 95 | + 'float16_test.cc', |
| 96 | + 'fixed_width_test.cc', |
| 97 | + 'formatting_util_test.cc', |
| 98 | + 'key_value_metadata_test.cc', |
| 99 | + 'hashing_test.cc', |
| 100 | + 'int_util_test.cc', |
| 101 | + ] + io_util_test_sources + [ |
| 102 | + 'iterator_test.cc', |
| 103 | + 'list_util_test.cc', |
| 104 | + 'logger_test.cc', |
| 105 | + 'logging_test.cc', |
| 106 | + 'queue_test.cc', |
| 107 | + 'range_test.cc', |
| 108 | + 'ree_util_test.cc', |
| 109 | + 'reflection_test.cc', |
| 110 | + 'rows_to_batches_test.cc', |
| 111 | + 'small_vector_test.cc', |
| 112 | + 'span_test.cc', |
| 113 | + 'stl_util_test.cc', |
| 114 | + 'string_test.cc', |
| 115 | + 'tdigest_test.cc', |
| 116 | + 'test_common.cc', |
| 117 | + 'time_test.cc', |
| 118 | + 'tracing_test.cc', |
| 119 | + 'trie_test.cc', |
| 120 | + 'uri_test.cc', |
| 121 | + 'utf8_util_test.cc', |
| 122 | + 'value_parsing_test.cc', |
| 123 | + ] |
| 124 | + tests = { |
| 125 | + |
| 126 | + 'arrow-bit-utility-test': { |
| 127 | + 'sources': [ |
| 128 | + 'bit_block_counter_test.cc', |
| 129 | + 'bit_util_test.cc', |
| 130 | + 'rle_encoding_test.cc', |
| 131 | + ], |
| 132 | + }, |
| 133 | + } |
| 134 | + |
| 135 | + foreach key, val : tests |
| 136 | + exc = executable( |
| 137 | + key, |
| 138 | + sources: val['sources'], |
| 139 | + dependencies: [arrow_test_dep], |
| 140 | + implicit_include_directories: false, # algorithm.h conflicts with stdlib |
| 141 | + ) |
| 142 | + test(key, exc) |
| 143 | + endforeach |
| 144 | +endif |
| 145 | + |
| 146 | +# TODO: add_benchmarks |
0 commit comments