Skip to content

Commit c8b714f

Browse files
kouamoeba
authored andcommitted
GH-47033: [C++][Compute] Never use custom gtest main with MSVC (#47049)
### Rationale for this change If we use custom gtest main with MSVC, it always reports "SEH exception". ### What changes are included in this PR? Remove MSVC version check. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #47033 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 45cf310 commit c8b714f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp/src/arrow/compute/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ 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-
if(MSVC AND MSVC_VERSION LESS 1930)
51+
if(MSVC)
5252
target_link_libraries(arrow_compute_testing
5353
PUBLIC $<TARGET_OBJECTS:arrow_compute_core_testing>
5454
PUBLIC ${ARROW_GTEST_GTEST_MAIN})

cpp/src/arrow/compute/test_env.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class ComputeKernelEnvironment : public ::testing::Environment {
3535

3636
} // namespace
3737

38-
#if defined(_MSC_VER) && _MSC_VER < 1930
38+
#ifdef _MSC_VER
3939
// Initialize the compute module
4040
::testing::Environment* compute_kernels_env =
4141
::testing::AddGlobalTestEnvironment(new ComputeKernelEnvironment);
4242
#endif
4343

4444
} // namespace arrow::compute
4545

46-
#if !(defined(_MSC_VER) && _MSC_VER < 1930)
46+
#ifndef _MSC_VER
4747
int main(int argc, char** argv) {
4848
::testing::InitGoogleTest(&argc, argv);
4949
::testing::AddGlobalTestEnvironment(new arrow::compute::ComputeKernelEnvironment);

0 commit comments

Comments
 (0)