Skip to content

Commit fc1c08b

Browse files
committed
Use grpc as subproject on Windows
1 parent 76902fe commit fc1c08b

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/cpp_extra.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,14 @@ jobs:
314314
env:
315315
ARROW_USE_MESON: ON
316316
ARROW_HOME: C:\arrow-dist
317-
MESON_SETUP_ARGS: "--vsenv -Dauto_features=enabled -Dfuzzing=disabled -Dgcs=disabled -Ds3=disabled -Dazure=disabled"
317+
MESON_SETUP_ARGS: "
318+
--vsenv
319+
--force-fallback-for=grpc++
320+
-Dauto_features=enabled
321+
-Dfuzzing=disabled
322+
-Dgcs=disabled
323+
-Ds3=disabled
324+
-Dazure=disabled"
318325
run: |
319326
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
320327
- name: Test

cpp/src/arrow/flight/meson.build

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@ install_headers(
4747
# Due to the Meson bug in https://github.com/mesonbuild/meson/issues/14905
4848
# we need to special how the grpc_cpp_plugin resolution is handled
4949
# when found on the system versus when built as a subproject
50-
grpc_cpp_dep = dependency('grpc++', allow_fallback: false, required: false)
51-
has_system_grpc = grpc_cpp_dep.found()
50+
# On Windows we always need to use a subproject, because Meson cannot
51+
# accurately detect if the system provides a shared/static library, and the
52+
# shared grpc files do not export symbols properly
53+
if host_machine.system() == 'windows'
54+
has_system_grpc = false
55+
else
56+
grpc_cpp_dep = dependency('grpc++', allow_fallback: false, required: false)
57+
has_system_grpc = grpc_cpp_dep.found()
58+
endif
5259
if not has_system_grpc
5360
grpc_opts = []
5461
if cpp_compiler.get_id() == 'msvc'
@@ -57,7 +64,8 @@ if not has_system_grpc
5764
're2:default_library=static', # re2 does not export symbols
5865
]
5966
endif
60-
grpc_cpp_dep = dependency('grpc++', default_options: grpc_opts)
67+
grpc_subproject = subproject('grpc', default_options: grpc_opts)
68+
grpc_cpp_dep = grpc_subproject.get_variable('grpcpp_dep')
6169
endif
6270

6371
protobuf_dep = dependency('protobuf')

0 commit comments

Comments
 (0)