Derek Mauro | 6a37c26 | 2023-03-31 10:25:57 -0700 | [diff] [blame] | 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 | |
| 15 | SETLOCAL ENABLEDELAYEDEXPANSION |
| 16 | |
| 17 | :: Set LLVM directory. |
| 18 | SET BAZEL_LLVM=C:\Program Files\LLVM |
| 19 | |
| 20 | :: Change directory to the root of the project. |
| 21 | CD %~dp0\.. |
| 22 | if %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. |
| 27 | IF "%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 |
| 32 | IF "%COMPILATION_MODE%"=="" SET COMPILATION_MODE=fastbuild |
| 33 | |
| 34 | :: Copy the alternate option file, if specified. |
| 35 | IF 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 Mauro | 1959993 | 2024-01-09 09:57:27 -0800 | [diff] [blame] | 42 | %KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe ^ |
Derek Mauro | 6a37c26 | 2023-03-31 10:25:57 -0700 | [diff] [blame] | 43 | test ... ^ |
| 44 | --compilation_mode=%COMPILATION_MODE% ^ |
| 45 | --compiler=clang-cl ^ |
Derek Mauro | 6a37c26 | 2023-03-31 10:25:57 -0700 | [diff] [blame] | 46 | --copt=/WX ^ |
| 47 | --copt=-Wno-microsoft-cast ^ |
Derek Mauro | 72dde98 | 2024-06-24 11:08:50 -0700 | [diff] [blame] | 48 | --cxxopt=/std:%STD% ^ |
Derek Mauro | 6a37c26 | 2023-03-31 10:25:57 -0700 | [diff] [blame] | 49 | --define=absl=1 ^ |
| 50 | --distdir=%KOKORO_GFILE_DIR%\distdir ^ |
Derek Mauro | 41a2a25 | 2024-01-11 15:58:39 -0800 | [diff] [blame] | 51 | --enable_bzlmod=true ^ |
Derek Mauro | 04af270 | 2024-01-29 15:04:23 -0800 | [diff] [blame] | 52 | --extra_execution_platforms=//:x64_windows-clang-cl ^ |
Derek Mauro | 1959993 | 2024-01-09 09:57:27 -0800 | [diff] [blame] | 53 | --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl ^ |
Derek Mauro | 6a37c26 | 2023-03-31 10:25:57 -0700 | [diff] [blame] | 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 | |
| 60 | if %errorlevel% neq 0 EXIT /B 1 |
| 61 | EXIT /B 0 |