blob: b031c30da845ed42f7b47f97b86b41577e98e109 [file] [log] [blame]
Derek Mauro6a37c262023-03-31 10:25:57 -07001:: 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
Derek Mauro19599932024-01-09 09:57:27 -080042%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe ^
Derek Mauro6a37c262023-03-31 10:25:57 -070043 test ... ^
44 --compilation_mode=%COMPILATION_MODE% ^
45 --compiler=clang-cl ^
Derek Mauro6a37c262023-03-31 10:25:57 -070046 --copt=/WX ^
47 --copt=-Wno-microsoft-cast ^
Derek Mauro72dde982024-06-24 11:08:50 -070048 --cxxopt=/std:%STD% ^
Derek Mauro6a37c262023-03-31 10:25:57 -070049 --define=absl=1 ^
50 --distdir=%KOKORO_GFILE_DIR%\distdir ^
Derek Mauro41a2a252024-01-11 15:58:39 -080051 --enable_bzlmod=true ^
Derek Mauro04af2702024-01-29 15:04:23 -080052 --extra_execution_platforms=//:x64_windows-clang-cl ^
Derek Mauro19599932024-01-09 09:57:27 -080053 --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl ^
Derek Mauro6a37c262023-03-31 10:25:57 -070054 --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