Skip to content

Commit 2946fcf

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

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

cpp/src/arrow/flight/CMakeLists.txt

Lines changed: 56 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,39 @@ 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+
endif()
369+
370+
# Suppress Abseil <ciso646> warnings in test files (GCC 15+ with C++20)
371+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
372+
if(TARGET arrow-flight-internals-test)
373+
target_compile_options(arrow-flight-internals-test PRIVATE "-Wno-cpp")
374+
endif()
375+
if(TARGET arrow-flight-test)
376+
target_compile_options(arrow-flight-test PRIVATE "-Wno-cpp")
377+
endif()
378+
if(TARGET arrow-async-grpc-poc-test)
379+
target_compile_options(arrow-async-grpc-poc-test PRIVATE "-Wno-cpp")
380+
endif()
381+
endif()
382+
337383
# Build test server for unit tests or benchmarks
338384
if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
339385
add_executable(flight-test-server test_server.cc)
340386
target_link_libraries(flight-test-server ${ARROW_FLIGHT_TEST_LINK_LIBS}
341387
${GFLAGS_LIBRARIES})
388+
# Suppress Abseil <ciso646> warnings (GCC 15+ with C++20)
389+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
390+
target_compile_options(flight-test-server PRIVATE "-Wno-cpp")
391+
endif()
342392

343393
if(ARROW_BUILD_TESTS)
344394
add_dependencies(arrow-flight-test flight-test-server)
@@ -365,6 +415,12 @@ if(ARROW_BUILD_BENCHMARKS)
365415
target_link_libraries(arrow-flight-benchmark ${ARROW_FLIGHT_TEST_LINK_LIBS}
366416
${GFLAGS_LIBRARIES})
367417

418+
# Suppress Abseil <ciso646> warnings (GCC 15+ with C++20)
419+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
420+
target_compile_options(arrow-flight-perf-server PRIVATE "-Wno-cpp")
421+
target_compile_options(arrow-flight-benchmark PRIVATE "-Wno-cpp")
422+
endif()
423+
368424
add_dependencies(arrow-flight-benchmark arrow-flight-perf-server)
369425

370426
add_dependencies(arrow_flight arrow-flight-benchmark)

0 commit comments

Comments
 (0)