• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17SET ABSL_GOOGLETEST_COMMIT=934542165899c786cb5d8a710529c37184730183
18
19IF EXIST %KOKORO_GFILE_DIR%\distdir\%ABSL_GOOGLETEST_COMMIT%.zip (
20  SET ABSL_GOOGLETEST_DOWNLOAD_URL=file://%KOKORO_GFILE_DIR%\distdir\%ABSL_GOOGLETEST_COMMIT%.zip
21) ELSE (
22  SET ABSL_GOOGLETEST_DOWNLOAD_URL=https://github.com/google/googletest/archive/%ABSL_GOOGLETEST_COMMIT%.zip
23)
24
25:: Replace '\' with '/' in Windows paths for CMake.
26:: Note that this cannot go inside the IF block above, because BAT files are weird.
27SET ABSL_GOOGLETEST_DOWNLOAD_URL=%ABSL_GOOGLETEST_DOWNLOAD_URL:\=/%
28
29IF EXIST "C:\Program Files\CMake\bin\" (
30  SET CMAKE_BIN="C:\Program Files\CMake\bin\cmake.exe"
31  SET CTEST_BIN="C:\Program Files\CMake\bin\ctest.exe"
32) ELSE (
33  SET CMAKE_BIN="cmake.exe"
34  SET CTEST_BIN="ctest.exe"
35)
36
37SET CTEST_OUTPUT_ON_FAILURE=1
38SET CMAKE_BUILD_PARALLEL_LEVEL=16
39SET CTEST_PARALLEL_LEVEL=16
40
41:: Change directory to the root of the project.
42CD %~dp0\..
43if %errorlevel% neq 0 EXIT /B 1
44
45SET TZDIR=%CD%\absl\time\internal\cctz\testdata\zoneinfo
46
47MKDIR "build"
48CD "build"
49
50SET CXXFLAGS="/WX"
51
52%CMAKE_BIN% ^
53  -DABSL_BUILD_TEST_HELPERS=ON ^
54  -DABSL_BUILD_TESTING=ON ^
55  -DABSL_GOOGLETEST_DOWNLOAD_URL=%ABSL_GOOGLETEST_DOWNLOAD_URL% ^
56  -DBUILD_SHARED_LIBS=%ABSL_CMAKE_BUILD_SHARED% ^
57  -DCMAKE_CXX_STANDARD=%ABSL_CMAKE_CXX_STANDARD% ^
58  -G "%ABSL_CMAKE_GENERATOR%" ^
59  ..
60IF %errorlevel% neq 0 EXIT /B 1
61
62%CMAKE_BIN% --build . --target ALL_BUILD --config %ABSL_CMAKE_BUILD_TYPE%
63IF %errorlevel% neq 0 EXIT /B 1
64
65%CTEST_BIN% -C %ABSL_CMAKE_BUILD_TYPE% -E "absl_lifetime_test|absl_symbolize_test"
66IF %errorlevel% neq 0 EXIT /B 1
67
68EXIT /B 0
69