From 4b491e3274693bcfe0e6a3e7e910aa8265bcee0a Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Tue, 11 Oct 2022 10:49:57 -0700 Subject: [PATCH] Use 64bit linker on windows even when creating 32bit targets (#31237) * Try CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE * Target * fix vcvarsall.bat argument Co-authored-by: Jan Tattermusch --- tools/run_tests/helper_scripts/build_cxx.bat | 2 +- tools/run_tests/run_tests.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/helper_scripts/build_cxx.bat b/tools/run_tests/helper_scripts/build_cxx.bat index 983418b36de..f288e032f51 100644 --- a/tools/run_tests/helper_scripts/build_cxx.bat +++ b/tools/run_tests/helper_scripts/build_cxx.bat @@ -45,7 +45,7 @@ If "%GRPC_CMAKE_GENERATOR%" == "Ninja" ( ) else ( @rem Use one of the Visual Studio generators. - cmake -G "%GRPC_CMAKE_GENERATOR%" -A "%GRPC_CMAKE_ARCHITECTURE%" -DgRPC_BUILD_TESTS=ON -DgRPC_BUILD_MSVC_MP_COUNT=%GRPC_RUN_TESTS_JOBS% %* ../.. || goto :error + cmake -G "%GRPC_CMAKE_GENERATOR%" -A "%GRPC_CMAKE_ARCHITECTURE%" -DCMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE=x64 -DgRPC_BUILD_TESTS=ON -DgRPC_BUILD_MSVC_MP_COUNT=%GRPC_RUN_TESTS_JOBS% %* ../.. || goto :error @rem GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX will be set to either "c" or "cxx" cmake --build . --target buildtests_%GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX% --config %MSBUILD_CONFIG% || goto :error diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index f02ffc05c3c..0c4f3400a30 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -278,7 +278,8 @@ class CLanguage(object): self._cmake_architecture_windows = 'x64' if self.args.arch == 'x64' else 'Win32' # when builing with Ninja, the VS common tools need to be activated first self._activate_vs_tools_windows = activate_vs_tools - self._vs_tools_architecture_windows = 'x64' if self.args.arch == 'x64' else 'x86' + # "x64_x86" means create 32bit binaries, but use 64bit toolkit to secure more memory for the build + self._vs_tools_architecture_windows = 'x64' if self.args.arch == 'x64' else 'x64_x86' else: if self.platform == 'linux':