diff --git a/cpp/examples/arrow/CMakeLists.txt b/cpp/examples/arrow/CMakeLists.txt index 8182083a4ba..00eff7ae03b 100644 --- a/cpp/examples/arrow/CMakeLists.txt +++ b/cpp/examples/arrow/CMakeLists.txt @@ -18,8 +18,14 @@ ADD_ARROW_EXAMPLE(row-wise-conversion-example) if (ARROW_PARQUET AND ARROW_DATASET) + if (ARROW_BUILD_SHARED) + set(DATASET_EXAMPLES_LINK_LIBS arrow_dataset_shared) + else() + set(DATASET_EXAMPLES_LINK_LIBS arrow_dataset_static) + endif() + ADD_ARROW_EXAMPLE(dataset-parquet-scan-example EXTRA_LINK_LIBS - arrow_dataset_shared) + ${DATASET_EXAMPLES_LINK_LIBS}) add_dependencies(dataset-parquet-scan-example parquet) endif()