Skip to content

Commit 0705f98

Browse files
committed
Some CMake requirements. I've fixed some things that are only required locally
1 parent c9666a5 commit 0705f98

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

cpp/src/arrow/flight/CMakeLists.txt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ if(CMAKE_UNITY_BUILD AND WIN32)
207207
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
208208
endif()
209209

210+
# Suppress warnings from Abseil headers using deprecated <ciso646> in C++20.
211+
# GCC 15+ with C++20 emits #warning which -Werror turns into an error.
212+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
213+
set(ARROW_FLIGHT_CXX20_WARNING_FLAGS "-Wno-cpp")
214+
set_source_files_properties(server_tracing_middleware.cc
215+
client_tracing_middleware.cc
216+
transport/grpc/grpc_client.cc
217+
transport/grpc/grpc_server.cc
218+
transport/grpc/serialization_internal.cc
219+
transport/grpc/protocol_grpc_internal.cc
220+
transport/grpc/util_internal.cc
221+
PROPERTIES COMPILE_OPTIONS
222+
"${ARROW_FLIGHT_CXX20_WARNING_FLAGS}")
223+
endif()
224+
210225
if(ARROW_WITH_OPENTELEMETRY)
211226
list(APPEND ARROW_FLIGHT_SRCS otel_logging.cc)
212227
endif()
@@ -320,6 +335,13 @@ if(ARROW_TESTING)
320335
foreach(LIB_TARGET ${ARROW_FLIGHT_TESTING_LIBRARIES})
321336
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)
322337
endforeach()
338+
339+
# Suppress Abseil <ciso646> warnings in testing library (GCC 15+ with C++20)
340+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
341+
set_source_files_properties(test_auth_handlers.cc test_definitions.cc
342+
test_flight_server.cc test_util.cc
343+
PROPERTIES COMPILE_OPTIONS "-Wno-cpp")
344+
endif()
323345
endif()
324346

325347
add_arrow_test(flight_internals_test
@@ -334,11 +356,54 @@ add_arrow_test(flight_test
334356
LABELS
335357
"arrow_flight")
336358

359+
# PoC: Async Flight server using gRPC generic callback API
360+
if(ARROW_BUILD_TESTS)
361+
add_arrow_test(async_grpc_poc_test
362+
SOURCES
363+
transport/grpc/async_grpc_poc_test.cc
364+
STATIC_LINK_LIBS
365+
${ARROW_FLIGHT_TEST_LINK_LIBS}
366+
LABELS
367+
"arrow_flight")
368+
369+
# Standalone async server for thread count validation
370+
add_executable(async-flight-server transport/grpc/async_server.cc)
371+
target_link_libraries(async-flight-server ${ARROW_FLIGHT_TEST_LINK_LIBS})
372+
target_compile_options(async-flight-server PRIVATE "-Wno-cpp")
373+
374+
# Standalone client for thread count validation
375+
add_executable(flight-client transport/grpc/client.cc)
376+
target_link_libraries(flight-client ${ARROW_FLIGHT_TEST_LINK_LIBS})
377+
target_compile_options(flight-client PRIVATE "-Wno-cpp")
378+
379+
# Standalone sync server for thread count comparison
380+
add_executable(sync-flight-server transport/grpc/sync_server.cc)
381+
target_link_libraries(sync-flight-server ${ARROW_FLIGHT_TEST_LINK_LIBS})
382+
target_compile_options(sync-flight-server PRIVATE "-Wno-cpp")
383+
endif()
384+
385+
# Suppress Abseil <ciso646> warnings in test files (GCC 15+ with C++20)
386+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
387+
if(TARGET arrow-flight-internals-test)
388+
target_compile_options(arrow-flight-internals-test PRIVATE "-Wno-cpp")
389+
endif()
390+
if(TARGET arrow-flight-test)
391+
target_compile_options(arrow-flight-test PRIVATE "-Wno-cpp")
392+
endif()
393+
if(TARGET arrow-async-grpc-poc-test)
394+
target_compile_options(arrow-async-grpc-poc-test PRIVATE "-Wno-cpp")
395+
endif()
396+
endif()
397+
337398
# Build test server for unit tests or benchmarks
338399
if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
339400
add_executable(flight-test-server test_server.cc)
340401
target_link_libraries(flight-test-server ${ARROW_FLIGHT_TEST_LINK_LIBS}
341402
${GFLAGS_LIBRARIES})
403+
# Suppress Abseil <ciso646> warnings (GCC 15+ with C++20)
404+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
405+
target_compile_options(flight-test-server PRIVATE "-Wno-cpp")
406+
endif()
342407

343408
if(ARROW_BUILD_TESTS)
344409
add_dependencies(arrow-flight-test flight-test-server)
@@ -365,6 +430,12 @@ if(ARROW_BUILD_BENCHMARKS)
365430
target_link_libraries(arrow-flight-benchmark ${ARROW_FLIGHT_TEST_LINK_LIBS}
366431
${GFLAGS_LIBRARIES})
367432

433+
# Suppress Abseil <ciso646> warnings (GCC 15+ with C++20)
434+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
435+
target_compile_options(arrow-flight-perf-server PRIVATE "-Wno-cpp")
436+
target_compile_options(arrow-flight-benchmark PRIVATE "-Wno-cpp")
437+
endif()
438+
368439
add_dependencies(arrow-flight-benchmark arrow-flight-perf-server)
369440

370441
add_dependencies(arrow_flight arrow-flight-benchmark)

0 commit comments

Comments
 (0)