Skip to content

Commit 64875bf

Browse files
committed
try win compat
1 parent aff951f commit 64875bf

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

cpp/src/arrow/compute/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ if(ARROW_TESTING AND ARROW_COMPUTE)
4848
add_library(arrow_compute_testing OBJECT ${ARROW_COMPUTE_TESTING_SRCS})
4949
# Even though this is still just an object library we still need to "link"
5050
# arrow_compute_core_testing so that is also included correctly
51-
target_link_libraries(arrow_compute_testing
52-
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
53-
PUBLIC ${ARROW_GTEST_GTEST})
51+
if(WIN32)
52+
target_link_libraries(arrow_compute_testing
53+
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
54+
PUBLIC ${ARROW_GTEST_GTEST_MAIN})
55+
else()
56+
target_link_libraries(arrow_compute_testing
57+
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
58+
PUBLIC ${ARROW_GTEST_GTEST})
59+
endif()
60+
5461
endif()
5562

5663
set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute")

cpp/src/arrow/compute/test_env.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@ class ComputeKernelEnvironment : public ::testing::Environment {
3434
};
3535

3636
} // namespace
37+
38+
#ifdef _WIN32
39+
// Initialize the compute module
40+
::testing::Environment* compute_kernels_env =
41+
::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
42+
#endif
43+
3744
} // namespace arrow::compute
3845

46+
#ifndef _WIN32
3947
int main(int argc, char** argv) {
4048
::testing::InitGoogleTest(&argc, argv);
4149
::testing::AddGlobalTestEnvironment(new arrow::compute::ComputeKernelEnvironment);
4250
return RUN_ALL_TESTS();
4351
}
52+
#endif

0 commit comments

Comments
 (0)