Skip to content

Commit

Permalink
test(storage): workaround MSVC limits (#8357)
Browse files Browse the repository at this point in the history
I have a different version of MSVC compared to the version used in CI.
The tests do not compile without `/bigobj`, and presumably this affects
customers too.  We probably should enable that option for all tests.
  • Loading branch information
coryan authored Feb 12, 2022
1 parent 5f0c674 commit 18082df
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions google/cloud/storage/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ if (BUILD_TESTING)
GTest::gtest)
add_test(NAME ${target} COMMAND ${target})
google_cloud_cpp_add_common_options(${target})
# With googletest it is relatively easy to exceed the default number of
# sections (~65,000) in a single .obj file. Add the /bigobj option to
# all the tests, even if it is not needed.
if (MSVC)
target_compile_options(${target} PRIVATE "/bigobj")
endif ()
endforeach ()

foreach (fname ${storage_examples})
Expand All @@ -95,6 +101,12 @@ if (BUILD_TESTING)
${target} PROPERTIES LABELS
"integration-test;integration-test-emulator")
google_cloud_cpp_add_common_options(${target})
# With googletest it is relatively easy to exceed the default number of
# sections (~65,000) in a single .obj file. Add the /bigobj option to
# all the tests, even if it is not needed.
if (MSVC)
target_compile_options(${target} PRIVATE "/bigobj")
endif ()
endforeach ()

# We just know that these tests need to be run against production.
Expand All @@ -107,5 +119,11 @@ if (BUILD_TESTING)
set_tests_properties(
${target} PROPERTIES LABELS
"integration-test;integration-test-production")
# With googletest it is relatively easy to exceed the default number of
# sections (~65,000) in a single .obj file. Add the /bigobj option to
# all the tests, even if it is not needed.
if (MSVC)
target_compile_options(${target} PRIVATE "/bigobj")
endif ()
endforeach ()
endif ()

0 comments on commit 18082df

Please sign in to comment.