Skip to content

Commit

Permalink
Fix MSVC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Jul 5, 2022
1 parent f27fa71 commit 5368d61
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cpp/src/arrow/flight/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ add_custom_command(OUTPUT ${FLIGHT_SQL_GENERATED_PROTO_FILES}
DEPENDS ${PROTO_DEPENDS})

set_source_files_properties(${FLIGHT_SQL_GENERATED_PROTO_FILES} PROPERTIES GENERATED TRUE)
if(MSVC)
# Suppress warnings caused by Protobuf (casts, dll-interface)
set_source_files_properties(${FLIGHT_SQL_GENERATED_PROTO_FILES} PROPERTIES COMPILE_FLAGS
"/wd4267")
endif()

add_custom_target(flight_sql_protobuf_gen ALL DEPENDS ${FLIGHT_SQL_GENERATED_PROTO_FILES})

set(ARROW_FLIGHT_SQL_SRCS
Expand Down Expand Up @@ -69,6 +63,10 @@ add_arrow_lib(arrow_flight_sql
PRIVATE_INCLUDES
"${Protobuf_INCLUDE_DIRS}")

if(MSVC)
# Suppress warnings caused by Protobuf (casts)
set_source_files_properties(protocol_internal.cc PROPERTIES COMPILE_FLAGS "/wd4267")
endif()
foreach(LIB_TARGET ${ARROW_FLIGHT_SQL_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_SQL_EXPORTING)
endforeach()
Expand Down

0 comments on commit 5368d61

Please sign in to comment.