Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/src/arrow/c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('arrow-dlpack-test', exc)
exc = executable(
'arrow-bridge-benchmark',
sources: ['bridge_benchmark.cc'],
dependencies: [arrow_test_dep, benchmark_dep],
dependencies: [arrow_benchmark_dep],
)
benchmark('arrow-bridge-benchmark', exc)

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/csv/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ foreach csv_benchmark : csv_benchmarks
exc = executable(
benchmark_name,
sources: '@0@.cc'.format(csv_benchmark),
dependencies: [arrow_test_dep, benchmark_dep],
dependencies: [arrow_benchmark_dep],
)
benchmark(benchmark_name, exc)
endforeach
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/io/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ foreach io_benchmark : io_benchmarks
exc = executable(
benchmark_name,
sources: '@0@.cc'.format(io_benchmark),
dependencies: [arrow_test_dep, benchmark_dep],
dependencies: [arrow_benchmark_dep],
implicit_include_directories: false,
)
benchmark(benchmark_name, exc)
Expand Down
45 changes: 27 additions & 18 deletions cpp/src/arrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ if needs_testing
filesystem_dep = boost_proj.dependency('boost_filesystem')
endif

gtest_dep = dependency('gtest')
gtest_main_dep = dependency('gtest_main')
gmock_dep = dependency('gmock')
else
filesystem_dep = disabler()
gtest_dep = disabler()
gtest_main_dep = disabler()
gmock_dep = disabler()
endif
Expand All @@ -404,10 +406,14 @@ arrow_test_lib = static_library(
dependencies: [arrow_dep, filesystem_dep, gtest_main_dep],
)

arrow_test_dep = declare_dependency(
link_with: [arrow_test_lib],
dependencies: [arrow_dep, filesystem_dep, gmock_dep, gtest_main_dep],
)
if needs_tests
arrow_test_dep = declare_dependency(
link_with: [arrow_test_lib],
dependencies: [arrow_dep, filesystem_dep, gmock_dep, gtest_main_dep],
)
else
arrow_test_dep = disabler()
endif

arrow_tests = {
'arrow-array-test': {
Expand Down Expand Up @@ -459,24 +465,27 @@ if needs_ipc
}
endif

if needs_tests
foreach key, val : arrow_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep, val.get('dependencies', [])],
)
test(key, exc)
endforeach
endif
foreach key, val : arrow_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep, val.get('dependencies', [])],
)
test(key, exc)
endforeach

if needs_benchmarks
benchmark_dep = dependency(
'benchmark',
benchmark_main_dep = dependency(
'benchmark-main',
default_options: {'tests': 'disabled'},
)

arrow_benchmark_dep = declare_dependency(
link_with: [arrow_test_lib],
dependencies: [arrow_dep, benchmark_main_dep, gtest_dep],
)
else
benchmark_dep = disabler()
arrow_benchmark_dep = disabler()
endif

arrow_benchmarks = [
Expand All @@ -493,7 +502,7 @@ foreach benchmark : arrow_benchmarks
exc = executable(
benchmark_name,
sources: '@0@.cc'.format(benchmark),
dependencies: [arrow_test_dep, benchmark_dep],
dependencies: [arrow_benchmark_dep],
)

benchmark(benchmark_name, exc)
Expand Down
40 changes: 19 additions & 21 deletions cpp/src/arrow/testing/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,25 @@ install_headers(
subdir: 'arrow/testing',
)

if needs_tests
testing_tests = {
'arrow-generator-test': {'sources': ['generator_test.cc']},
'arrow-gtest-util-test': {'sources': ['gtest_util_test.cc']},
'arrow-random-test': {'sources': ['random_test.cc']},
}
testing_tests = {
'arrow-generator-test': {'sources': ['generator_test.cc']},
'arrow-gtest-util-test': {'sources': ['gtest_util_test.cc']},
'arrow-random-test': {'sources': ['random_test.cc']},
}

foreach key, val : testing_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep, val.get('dependencies', [])],
)
test(key, exc)
endforeach
foreach key, val : testing_tests
exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep, val.get('dependencies', [])],
)
test(key, exc)
endforeach

if needs_filesystem
library(
'arrow-filesystem-example',
sources: ['examplefs.cc'],
dependencies: [arrow_dep, gtest_main_dep],
)
endif
if needs_tests and needs_filesystem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is intentional to require both tests and the filesystem options to be enabled, but it mirrors what CMake currently requires

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intentional. We can use this as a loadable filesystem.

shared_module(
'arrow-filesystem-example',
sources: ['examplefs.cc'],
dependencies: [arrow_dep, gtest_dep],
)
endif