From a69dfe63bc26c12fd2786aec9239076997110315 Mon Sep 17 00:00:00 2001 From: Roman Popov Date: Mon, 30 Jul 2018 21:55:44 -0700 Subject: [PATCH] tests: fix link failure and stack overflow on Mingw w64 --- cmake/tests.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/tests.cmake b/cmake/tests.cmake index f91567b8d..603d7e952 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -206,6 +206,13 @@ endif() if(MINGW) set_source_files_properties(${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing") + + # required for tests on MinGW Win64 + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj") + endif() + endif() add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files})