kou commented on code in PR #13346:
URL: https://github.com/apache/arrow/pull/13346#discussion_r892961162


##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3657,8 +3657,22 @@ macro(build_grpc)
   # Yuck, see https://stackoverflow.com/a/45433229/776560
   string(REPLACE ";" "|" GRPC_PREFIX_PATH_ALT_SEP "${GRPC_CMAKE_PREFIX}")
 
+  if(NOT MSVC)
+    # Negate warnings that gRPC cannot build under
+    # See https://github.com/grpc/grpc/issues/29417
+    set(GRPC_C_FLAGS
+        "${EP_C_FLAGS} -Wno-attributes -Wno-format-security 
-Wno-unknown-warning-option")
+    set(GRPC_CXX_FLAGS
+        "${EP_CXX_FLAGS} -Wno-attributes -Wno-format-security 
-Wno-unknown-warning-option"
+    )
+  endif()

Review Comment:
   We need to initialize `GRPC_C*_FLAGS` for MSVC.
   
   e.g.:
   
   ```cmake
   set(GRPC_C_FLAGS "${EP_C_FLAGS}")
   set(GRPC_CXX_FLAGS "${EP_CXX_FLAGS}")
   if(NOT MSVC)
     set(GRPC_C_FLAGS "${GRPC_C_FLAGS} ...")
     set(GRPC_CXX_FLAGS "${GRPC_CXX_FLAGS} ...")
   endif()
   ```
   
   Or
   
   ```cmake
   set(GRPC_CMAKE_ARGS ...)
   if(NOT MSVC)
     set(GRPC_C_FLAGS "${EP_C_FLAGS} ...")
     set(GRPC_CXX_FLAGS "${EP_CXX_FLAGS} ...")
     list(APPEND GRPC_CMAKE_ARGS "-DCMAKE_C_FLAGS=${GRPC_C_FLAGS}" ...)
   endif()
   ```



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