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


##########
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:
   The CMake configuration currently does not have this export macro, and it 
looks like the FlightDataDeserialize test currently has:
   
   ```cpp
     GTEST_SKIP() << "Can't use Protobuf symbols on Windows";
   ```
   
   So perhaps this should be ported to CMake as well? Not sure the extent of 
Flight support on Windows, but maybe @lidavidm has thoughts?



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