kou commented on code in PR #46922:
URL: https://github.com/apache/arrow/pull/46922#discussion_r2176542096


##########
cpp/src/arrow/dataset/CMakeLists.txt:
##########
@@ -207,8 +207,29 @@ if(ARROW_PARQUET)
 endif()
 
 if(ARROW_BUILD_BENCHMARKS)
-  add_arrow_benchmark(file_benchmark PREFIX "arrow-dataset")
-  add_arrow_benchmark(scanner_benchmark PREFIX "arrow-dataset")
+  function(add_arrow_dataset_benchmark REL_BENCHMARK_NAME)
+    set(options)
+    set(one_value_args PREFIX)
+    set(multi_value_args)
+    cmake_parse_arguments(ARG
+                          "${options}"
+                          "${one_value_args}"
+                          "${multi_value_args}"
+                          ${ARGN})
+
+    if(ARG_PREFIX)
+      set(PREFIX ${ARG_PREFIX})
+    else()
+      set(PREFIX "arrow-dataset")
+    endif()
+
+    # Dataset benchmarks require compute kernels initialization.
+    add_arrow_compute_benchmark(${REL_BENCHMARK_NAME} PREFIX ${PREFIX}
+                                ${ARG_UNPARSED_ARGUMENTS})
+  endfunction()
+
+  add_arrow_dataset_benchmark(file_benchmark)
+  add_arrow_dataset_benchmark(scanner_benchmark)
 
   if(ARROW_BUILD_STATIC)
     target_link_libraries(arrow-dataset-file-benchmark PUBLIC 
arrow_dataset_static)

Review Comment:
   Can we do this in `add_arrow_dataset_benchmark()` (by `EXTRA_LINK_LIBS)` and 
remove the outer `if(ARROW_BUILD_BENCHMARKS)`?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to