From 81711045e8bb4ded1cb3b5a6fa354b35f18aa4e7 Mon Sep 17 00:00:00 2001 From: William Ayd Date: Tue, 28 May 2024 20:31:59 -0400 Subject: [PATCH] fix: Force static library build on Windows when building with Meson (#496) May not necessarily fix https://github.com/apache/arrow-nanoarrow/issues/495 but reasonably defers trying to solve --- src/nanoarrow/meson.build | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/nanoarrow/meson.build b/src/nanoarrow/meson.build index f60772aac..801440ea5 100644 --- a/src/nanoarrow/meson.build +++ b/src/nanoarrow/meson.build @@ -39,13 +39,24 @@ configure_file(input: 'nanoarrow_config.h.in', output: 'nanoarrow_config.h', configuration: conf_data) -nanoarrow_lib = library( +# Windows shared libraries are not exporting the right symbols +# See https://github.com/mesonbuild/wrapdb/pull/1536#issuecomment-2136011408 +# and https://github.com/apache/arrow-nanoarrow/issues/495 +if host_machine.system() == 'windows' + libtype = 'static_library' +else + libtype = 'library' +endif + +nanoarrow_lib = build_target( 'nanoarrow', 'array.c', 'schema.c', 'array_stream.c', 'utils.c', - install: true) + install: true, + target_type: libtype, +) curdir = include_directories('.') # only needed when used as subproject? incdir = include_directories('..')