WillAyd commented on code in PR #47413:
URL: https://github.com/apache/arrow/pull/47413#discussion_r2301275978


##########
cpp/src/arrow/flight/meson.build:
##########
@@ -52,14 +52,29 @@ fs = import('fs')
 protoc = find_program('protoc')
 
 flight_proto_path = fs.parent(meson.project_source_root()) / 'format'
+
+# To ensure messages from proto files are created correctly, we need to
+# pass in dllexport_decl=<...> . Unfortunately, it doesn't appear that we
+# can just pass in dllexport_decl=ARROW_FLIGHT_EXPORT, as the visibility
+# macro won't be easily available to the generated proto file. See also
+# https://github.com/protocolbuffers/protobuf/issues/19422
+if cpp_compiler.get_id() == 'msvc'
+    proto_visibility = '__declspec(dllexport)'
+else
+    proto_visibility = '__attribute__((visibility("default")))'
+endif
+
 flight_proto_files = custom_target(
     'arrow-flight-proto-files',
     input: [flight_proto_path / 'Flight.proto'],
     output: ['Flight.pb.cc', 'Flight.pb.h'],
     command: [
         protoc,
         '--proto_path=' + flight_proto_path,
-        '--cpp_out=' + meson.current_build_dir(),
+        '--cpp_out=dllexport_decl=@0@:@1@'.format(

Review Comment:
   See https://github.com/apache/arrow/issues/47429 - my naieve attempt at a 
fix did not work. Looks like there are some more complicating factors with how 
gRPC and the Flight tests are getting linked...but in any case its there to 
track



-- 
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