pitrou commented on code in PR #46922: URL: https://github.com/apache/arrow/pull/46922#discussion_r2182673402
########## cpp/src/arrow/acero/CMakeLists.txt: ########## @@ -188,68 +192,58 @@ add_arrow_acero_test(hash_aggregate_test SOURCES hash_aggregate_test.cc) add_arrow_acero_test(test_util_internal_test SOURCES test_util_internal_test.cc) -if(ARROW_BUILD_BENCHMARKS) - function(add_arrow_acero_benchmark REL_BENCHMARK_NAME) - set(options) - set(one_value_args PREFIX) - set(multi_value_args LABELS) - cmake_parse_arguments(ARG - "${options}" - "${one_value_args}" - "${multi_value_args}" - ${ARGN}) - - if(ARG_PREFIX) - set(PREFIX ${ARG_PREFIX}) - else() - set(PREFIX "arrow-acero") - endif() - - if(ARG_LABELS) - set(LABELS ${ARG_LABELS}) - else() - set(LABELS "arrow_acero") - endif() - - add_arrow_benchmark(${REL_BENCHMARK_NAME} - EXTRA_LINK_LIBS - ${ARROW_ACERO_TEST_LINK_LIBS} - PREFIX - ${PREFIX} - LABELS - ${LABELS} - ${ARG_UNPARSED_ARGUMENTS}) - endfunction() - - add_arrow_acero_benchmark(expression_benchmark SOURCES expression_benchmark.cc) - - add_arrow_acero_benchmark(filter_benchmark SOURCES benchmark_util.cc - filter_benchmark.cc) - - add_arrow_acero_benchmark(project_benchmark SOURCES benchmark_util.cc - project_benchmark.cc) - - add_arrow_acero_benchmark(asof_join_benchmark SOURCES asof_join_benchmark.cc) - - add_arrow_acero_benchmark(tpch_benchmark SOURCES tpch_benchmark.cc) - - add_arrow_acero_benchmark(aggregate_benchmark SOURCES aggregate_benchmark.cc) - - add_arrow_acero_benchmark(hash_join_benchmark SOURCES hash_join_benchmark.cc) - - if(ARROW_BUILD_STATIC) - target_link_libraries(arrow-acero-expression-benchmark PUBLIC arrow_acero_static) - target_link_libraries(arrow-acero-filter-benchmark PUBLIC arrow_acero_static) - target_link_libraries(arrow-acero-project-benchmark PUBLIC arrow_acero_static) - target_link_libraries(arrow-acero-asof-join-benchmark PUBLIC arrow_acero_static) - target_link_libraries(arrow-acero-tpch-benchmark PUBLIC arrow_acero_static) - target_link_libraries(arrow-acero-hash-join-benchmark PUBLIC arrow_acero_static) +function(add_arrow_acero_benchmark REL_BENCHMARK_NAME) + set(options) + set(one_value_args PREFIX) + set(multi_value_args LABELS EXTRA_LINK_LIBS) + cmake_parse_arguments(ARG + "${options}" + "${one_value_args}" + "${multi_value_args}" + ${ARGN}) + + if(ARG_PREFIX) + set(PREFIX ${ARG_PREFIX}) else() - target_link_libraries(arrow-acero-expression-benchmark PUBLIC arrow_acero_shared) - target_link_libraries(arrow-acero-filter-benchmark PUBLIC arrow_acero_shared) - target_link_libraries(arrow-acero-project-benchmark PUBLIC arrow_acero_shared) - target_link_libraries(arrow-acero-asof-join-benchmark PUBLIC arrow_acero_shared) - target_link_libraries(arrow-acero-tpch-benchmark PUBLIC arrow_acero_shared) - target_link_libraries(arrow-acero-hash-join-benchmark PUBLIC arrow_acero_shared) + set(PREFIX "arrow-acero") endif() -endif() + + if(ARG_LABELS) + set(LABELS ${ARG_LABELS}) + else() + set(LABELS "arrow_acero") + endif() + + if(ARROW_TEST_LINKAGE STREQUAL "static") + set(EXTRA_LINK_LIBS arrow_acero_static ${ARROW_ACERO_BENCHMARKS_TEST_LINK_LIBS}) + else() + set(EXTRA_LINK_LIBS arrow_acero_shared ${ARROW_ACERO_BENCHMARKS_TEST_LINK_LIBS}) + endif() + if(ARG_EXTRA_LINK_LIBS) + list(APPEND EXTRA_LINK_LIBS ${ARG_EXTRA_LINK_LIBS}) + endif() + + add_arrow_compute_benchmark(${REL_BENCHMARK_NAME} + EXTRA_LINK_LIBS + ${EXTRA_LINK_LIBS} + PREFIX + ${PREFIX} + LABELS + ${LABELS} + ${ARG_UNPARSED_ARGUMENTS}) +endfunction() + +add_arrow_acero_benchmark(expression_benchmark) Review Comment: Can we order these benchmarks alphabetically? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org