mirror of https://github.com/google/googletest.git
cmake: Centralize MinGW/Cygwin -Wa,-mbig-obj test workaround
This commit is contained in:
parent
a2118f6587
commit
7e3704f106
|
|
@ -131,10 +131,6 @@ if (gmock_build_tests)
|
|||
# 'make test' or ctest.
|
||||
enable_testing()
|
||||
|
||||
if (MINGW OR CYGWIN)
|
||||
add_compile_options("-Wa,-mbig-obj")
|
||||
endif()
|
||||
|
||||
############################################################
|
||||
# C++ tests built with standard compiler flags.
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,13 @@ function(cxx_executable_with_flags name cxx_flags libs)
|
|||
if (MSVC)
|
||||
# BigObj required for tests.
|
||||
set(cxx_flags "${cxx_flags} -bigobj")
|
||||
elseif (MINGW OR CYGWIN)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
|
||||
CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# MinGW and Cygwin use the GNU assembler, which has a 2^16 section limit.
|
||||
# Large generated test executables exceed this limit, so raise it.
|
||||
set(cxx_flags "${cxx_flags} -Wa,-mbig-obj")
|
||||
endif()
|
||||
endif()
|
||||
if (cxx_flags)
|
||||
set_target_properties(${name}
|
||||
|
|
|
|||
Loading…
Reference in New Issue