Skip to content

Commit a7af472

Browse files
committed
Instead of using global flags, try to handle header conflict on flight's cmake
1 parent 6a9f387 commit a7af472

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ci/scripts/python_wheel_windows_build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ cmake ^
7171
-DARROW_BUILD_TESTS=OFF ^
7272
-DARROW_COMPUTE=ON ^
7373
-DARROW_CSV=ON ^
74-
-DARROW_CXXFLAGS="/MP /DNOMINMAX /FI\"winsock2.h\" /FI\"ws2tcpip.h\"" ^
74+
-DARROW_CXXFLAGS="/MP" ^
7575
-DARROW_DATASET=%ARROW_DATASET% ^
7676
-DARROW_DEPENDENCY_SOURCE=VCPKG ^
7777
-DARROW_DEPENDENCY_USE_SHARED=OFF ^

cpp/src/arrow/flight/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
231231
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)
232232
endforeach()
233233

234+
# Handle Unity build header conflicts on Windows
235+
if(CMAKE_UNITY_BUILD AND WIN32)
236+
foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES})
237+
target_compile_options(${LIB_TARGET}
238+
PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/FI\"winsock2.h\">"
239+
"$<$<CXX_COMPILER_ID:MSVC>:/FI\"ws2tcpip.h\">")
240+
endforeach()
241+
endif()
242+
234243
# Define arrow_flight_testing library
235244
if(ARROW_TESTING)
236245
if(ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC)

0 commit comments

Comments
 (0)