This is an automated email from the ASF dual-hosted git repository.

willayd pushed a commit to branch meson-win-support
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 764651e41819f9d989f4d6061a9c286d1208d550
Author: Will Ayd <[email protected]>
AuthorDate: Thu Aug 7 03:00:16 2025 -0400

    GH-46797: [C++] Support Meson on Windows
---
 cpp/src/arrow/compute/kernels/ree_util_internal.h |  6 +++---
 cpp/src/arrow/meson.build                         | 25 +++++++++++++++++++++--
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/cpp/src/arrow/compute/kernels/ree_util_internal.h 
b/cpp/src/arrow/compute/kernels/ree_util_internal.h
index 5d447339a3..d1410a007c 100644
--- a/cpp/src/arrow/compute/kernels/ree_util_internal.h
+++ b/cpp/src/arrow/compute/kernels/ree_util_internal.h
@@ -347,7 +347,7 @@ Result<std::shared_ptr<ArrayData>> PreallocateRunEndsArray(
 /// \param has_validity_buffer a validity buffer must be allocated
 /// \param length the length of the values array
 /// \param data_buffer_size the size of the data buffer for string and binary 
types
-ARROW_COMPUTE_EXPORT Result<std::shared_ptr<ArrayData>> PreallocateValuesArray(
+ARROW_EXPORT Result<std::shared_ptr<ArrayData>> PreallocateValuesArray(
     const std::shared_ptr<DataType>& value_type, bool has_validity_buffer, 
int64_t length,
     MemoryPool* pool, int64_t data_buffer_size);
 
@@ -363,7 +363,7 @@ ARROW_COMPUTE_EXPORT Result<std::shared_ptr<ArrayData>> 
PreallocateValuesArray(
 /// data.child_data[1].buffer[0] != NULLPTR
 ///
 /// \param data_buffer_size the size of the data buffer for string and binary 
types
-ARROW_COMPUTE_EXPORT Result<std::shared_ptr<ArrayData>> PreallocateREEArray(
+ARROW_EXPORT Result<std::shared_ptr<ArrayData>> PreallocateREEArray(
     std::shared_ptr<RunEndEncodedType> ree_type, bool has_validity_buffer,
     int64_t logical_length, int64_t physical_length, MemoryPool* pool,
     int64_t data_buffer_size);
@@ -378,7 +378,7 @@ ARROW_COMPUTE_EXPORT Result<std::shared_ptr<ArrayData>> 
PreallocateREEArray(
 /// - run_ends fits in the run-end type without overflow
 void WriteSingleRunEnd(ArrayData* run_ends_data, int64_t run_end);
 
-ARROW_COMPUTE_EXPORT Result<std::shared_ptr<ArrayData>> MakeNullREEArray(
+ARROW_EXPORT Result<std::shared_ptr<ArrayData>> MakeNullREEArray(
     const std::shared_ptr<DataType>& run_end_type, int64_t logical_length,
     MemoryPool* pool);
 
diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
index c1efd9df76..b962063ffe 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -15,7 +15,11 @@
 # specific language governing permissions and limitations
 # under the License.
 
-dl_dep = dependency('dl')
+if host_machine.system() != 'windows'
+  dl_dep = dependency('dl')
+else
+  dl_dep = declare_dependency()
+endif
 threads_dep = dependency('threads')
 
 arrow_components = {
@@ -423,12 +427,21 @@ arrow_lib = library(
     dependencies: arrow_deps,
     install: true,
     gnu_symbol_visibility: 'hidden',
-    cpp_shared_args: ['-DARROW_EXPORTING'],
+    c_shared_args: ['-DARROW_EXPORTING', '-DURI_LIBRARY_BUILD', 
'-DURI_VISIBILITY'],
+    c_static_args: ['-DURI_STATIC_BUILD'],
+    cpp_shared_args: ['-DARROW_EXPORTING', '-DURI_LIBRARY_BUILD'],
+    cpp_static_args: ['-DARROW_STATIC'],
 )
 
+arrow_compile_args = []
+if host_machine.system() == 'windows' and get_option('default_library') != 
'shared'
+    arrow_compile_args += ['-DARROW_STATIC']
+endif
+
 arrow_dep = declare_dependency(
     include_directories: [include_dir],
     link_with: arrow_lib,
+    compile_args: arrow_compile_args,
 )
 
 if needs_compute
@@ -487,11 +500,19 @@ if needs_compute
         dependencies: arrow_dep,
         install: true,
         cpp_shared_args: ['-DARROW_COMPUTE_EXPORTING'],
+        cpp_static_args: ['-DARROW_COMPUTE_STATIC'],
     )
+
+    arrow_compute_compile_args = []
+    if host_machine.system() == 'windows' and get_option('default_library') != 
'shared'
+        arrow_compute_compile_args += ['-DARROW_COMPUTE_STATIC']
+    endif
+
     arrow_compute_dep = declare_dependency(
         link_with: arrow_compute_lib,
         include_directories: include_dir,
         dependencies: arrow_dep,
+        compile_args: arrow_compute_compile_args,
     )
 else
     arrow_compute_dep = disabler()

Reply via email to