2022-10-17 10:39:12 -07:00
|
|
|
SETLOCAL ENABLEDELAYEDEXPANSION
|
|
|
|
|
2025-02-12 09:43:29 -08:00
|
|
|
SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-8.0.0-windows-x86_64.exe
|
2022-10-17 10:39:12 -07:00
|
|
|
|
2023-03-28 06:27:28 -07:00
|
|
|
SET PATH=C:\Python34;%PATH%
|
|
|
|
SET BAZEL_PYTHON=C:\python34\python.exe
|
2022-10-17 10:39:12 -07:00
|
|
|
SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe
|
2023-03-27 12:09:24 -07:00
|
|
|
SET CMAKE_BIN="cmake.exe"
|
|
|
|
SET CTEST_BIN="ctest.exe"
|
2022-10-17 10:39:12 -07:00
|
|
|
SET CTEST_OUTPUT_ON_FAILURE=1
|
2023-03-27 12:09:24 -07:00
|
|
|
SET CMAKE_BUILD_PARALLEL_LEVEL=16
|
|
|
|
SET CTEST_PARALLEL_LEVEL=16
|
2022-10-17 10:39:12 -07:00
|
|
|
|
2025-02-12 09:43:29 -08:00
|
|
|
SET GTEST_ROOT=%~dp0\..
|
2022-10-17 10:39:12 -07:00
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|
|
|
|
|
|
|
|
:: ----------------------------------------------------------------------------
|
2023-03-28 06:27:28 -07:00
|
|
|
:: CMake
|
2025-02-12 09:43:29 -08:00
|
|
|
SET CMAKE_BUILD_PATH=cmake_msvc2022
|
|
|
|
MKDIR %CMAKE_BUILD_PATH%
|
|
|
|
CD %CMAKE_BUILD_PATH%
|
2022-10-17 10:39:12 -07:00
|
|
|
|
2025-02-12 09:43:29 -08:00
|
|
|
%CMAKE_BIN% %GTEST_ROOT% ^
|
2023-03-28 06:27:28 -07:00
|
|
|
-G "Visual Studio 17 2022" ^
|
2025-02-12 09:43:29 -08:00
|
|
|
-DCMAKE_CXX_STANDARD=17 ^
|
2022-10-17 10:39:12 -07:00
|
|
|
-DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^
|
|
|
|
-DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^
|
|
|
|
-DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^
|
|
|
|
-Dgtest_build_samples=ON ^
|
|
|
|
-Dgtest_build_tests=ON ^
|
|
|
|
-Dgmock_build_tests=ON
|
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|
|
|
|
|
|
|
|
%CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount
|
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|
|
|
|
|
|
|
|
%CTEST_BIN% -C Debug --timeout 600
|
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|
|
|
|
|
2025-02-12 09:43:29 -08:00
|
|
|
CD %GTEST_ROOT%
|
|
|
|
RMDIR /S /Q %CMAKE_BUILD_PATH%
|
2022-10-17 10:39:12 -07:00
|
|
|
|
|
|
|
:: ----------------------------------------------------------------------------
|
2023-03-28 06:27:28 -07:00
|
|
|
:: Bazel
|
2022-10-17 10:39:12 -07:00
|
|
|
|
2024-07-30 13:17:08 -07:00
|
|
|
:: The default home directory on Kokoro is a long path which causes errors
|
|
|
|
:: because of Windows limitations on path length.
|
|
|
|
:: --output_user_root=C:\tmp causes Bazel to use a shorter path.
|
2023-03-27 12:09:24 -07:00
|
|
|
SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community
|
2025-02-12 09:43:29 -08:00
|
|
|
|
|
|
|
:: C++17
|
|
|
|
%BAZEL_EXE% ^
|
|
|
|
--output_user_root=C:\tmp ^
|
|
|
|
test ... ^
|
|
|
|
--compilation_mode=dbg ^
|
|
|
|
--copt=/std:c++17 ^
|
|
|
|
--copt=/WX ^
|
|
|
|
--enable_bzlmod=true ^
|
|
|
|
--keep_going ^
|
|
|
|
--test_output=errors ^
|
|
|
|
--test_tag_filters=-no_test_msvc2017
|
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|
|
|
|
|
|
|
|
:: C++20
|
2024-07-30 13:17:08 -07:00
|
|
|
%BAZEL_EXE% ^
|
|
|
|
--output_user_root=C:\tmp ^
|
|
|
|
test ... ^
|
2022-10-17 10:39:12 -07:00
|
|
|
--compilation_mode=dbg ^
|
2025-02-12 09:43:29 -08:00
|
|
|
--copt=/std:c++20 ^
|
2022-10-17 10:39:12 -07:00
|
|
|
--copt=/WX ^
|
2024-01-25 10:27:14 -08:00
|
|
|
--enable_bzlmod=true ^
|
2022-10-17 10:39:12 -07:00
|
|
|
--keep_going ^
|
|
|
|
--test_output=errors ^
|
|
|
|
--test_tag_filters=-no_test_msvc2017
|
|
|
|
IF %errorlevel% neq 0 EXIT /B 1
|