xref: /aosp_15_r20/external/cronet/third_party/abseil-cpp/ci/windows_clangcl_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:: Set LLVM directory.
18SET BAZEL_LLVM=C:\Program Files\LLVM
19
20:: Change directory to the root of the project.
21CD %~dp0\..
22if %errorlevel% neq 0 EXIT /B 1
23
24:: Set the standard version, [c++14|c++17|c++20|c++latest]
25:: https://msdn.microsoft.com/en-us/library/mt490614.aspx
26:: The default is c++14 if not set on command line.
27IF "%STD%"=="" SET STD=c++14
28
29:: Set the compilation_mode (fastbuild|opt|dbg)
30:: https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode
31:: The default is fastbuild
32IF "%COMPILATION_MODE%"=="" SET COMPILATION_MODE=fastbuild
33
34:: Copy the alternate option file, if specified.
35IF NOT "%ALTERNATE_OPTIONS%"=="" copy %ALTERNATE_OPTIONS% absl\base\options.h
36
37:: To upgrade Bazel, first download a new binary from
38:: https://github.com/bazelbuild/bazel/releases and copy it to
39:: /google/data/rw/teams/absl/kokoro/windows.
40::
41:: TODO(absl-team): Remove -Wno-microsoft-cast
42%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe ^
43  test ... ^
44  --compilation_mode=%COMPILATION_MODE% ^
45  --compiler=clang-cl ^
46  --copt=/std:%STD% ^
47  --copt=/WX ^
48  --copt=-Wno-microsoft-cast ^
49  --define=absl=1 ^
50  --distdir=%KOKORO_GFILE_DIR%\distdir ^
51  --enable_bzlmod=true ^
52  --extra_execution_platforms=//:x64_windows-clang-cl ^
53  --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl ^
54  --keep_going ^
55  --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" ^
56  --test_env=TZDIR="%CD%\absl\time\internal\cctz\testdata\zoneinfo" ^
57  --test_output=errors ^
58  --test_tag_filters=-benchmark
59
60if %errorlevel% neq 0 EXIT /B 1
61EXIT /B 0
62