windows_clangcl_bazel.bat (2200B)
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++17|c++20|c++latest] 25 :: https://msdn.microsoft.com/en-us/library/mt490614.aspx 26 :: The default is c++17 if not set on command line. 27 IF "%STD%"=="" SET STD=c++17 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 42 %KOKORO_GFILE_DIR%\bazel-8.0.0-windows-x86_64.exe ^ 43 test ... ^ 44 --compilation_mode=%COMPILATION_MODE% ^ 45 --compiler=clang-cl ^ 46 --copt=/WX ^ 47 --copt=-Wno-microsoft-cast ^ 48 --cxxopt=/std:%STD% ^ 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 60 if %errorlevel% neq 0 EXIT /B 1 61 EXIT /B 0