xref: /aosp_15_r20/external/cronet/third_party/abseil-cpp/ci/windows_msvc_bazel.bat (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1:: Copyright 2023 The Abseil Authors
2::
3:: Licensed under the Apache License, Version 2.0 (the "License");
4:: you may not use this file except in compliance with the License.
5:: You may obtain a copy of the License at
6::
7::     https://www.apache.org/licenses/LICENSE-2.0
8::
9:: Unless required by applicable law or agreed to in writing, software
10:: distributed under the License is distributed on an "AS IS" BASIS,
11:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12:: See the License for the specific language governing permissions and
13:: limitations under the License.
14
15SETLOCAL ENABLEDELAYEDEXPANSION
16
17:: Change directory to the root of the project.
18CD %~dp0\..
19if %errorlevel% neq 0 EXIT /B 1
20
21:: Set the standard version, [c++14|c++latest]
22:: https://msdn.microsoft.com/en-us/library/mt490614.aspx
23:: The default is c++14 if not set on command line.
24IF "%STD%"=="" SET STD=c++14
25
26:: Set the compilation_mode (fastbuild|opt|dbg)
27:: https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode
28:: The default is fastbuild
29IF "%COMPILATION_MODE%"=="" SET COMPILATION_MODE=fastbuild
30
31:: Copy the alternate option file, if specified.
32IF NOT "%ALTERNATE_OPTIONS%"=="" copy %ALTERNATE_OPTIONS% absl\base\options.h
33
34:: To upgrade Bazel, first download a new binary from
35:: https://github.com/bazelbuild/bazel/releases and copy it to
36:: /google/data/rw/teams/absl/kokoro/windows.
37%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe ^
38  test ... ^
39  --compilation_mode=%COMPILATION_MODE% ^
40  --copt=/WX ^
41  --copt=/std:%STD% ^
42  --define=absl=1 ^
43  --distdir=%KOKORO_GFILE_DIR%\distdir ^
44  --enable_bzlmod=true ^
45  --keep_going ^
46  --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" ^
47  --test_env=TZDIR="%CD%\absl\time\internal\cctz\testdata\zoneinfo" ^
48  --test_output=errors ^
49  --test_tag_filters=-benchmark
50
51if %errorlevel% neq 0 EXIT /B 1
52EXIT /B 0
53