SPIRV-Tools/kokoro/scripts/windows/build.bat
github-actions[bot] c7e436921a
roll deps (#5243)
* Roll external/effcee/ 66edefd2b..77a53ba53 (1 commit)

66edefd2bb...77a53ba53b

$ git log 66edefd2b..77a53ba53 --date=short --no-merges --format='%ad %ae %s'
2023-05-26 dneto Add Abseil dependency, via RE2

Created with:
  roll-dep external/effcee

* Roll external/re2/ c9cba7606..03da4fc08 (18 commits)

c9cba76063...03da4fc085

$ git log c9cba7606..03da4fc08 --date=short --no-merges --format='%ad %ae %s'
2023-05-26 junyer Use `--enable_platform_specific_config` in `.bazelrc`.
2023-05-24 junyer Call `find_package()` conditionally.
2023-05-19 junyer Install CMake in the `gcc:13` container.
2023-05-19 junyer Sigh. I forgot to omit `sudo` because running under Docker.
2023-05-19 junyer Fix the CMake build on Ubuntu.
2023-05-19 junyer Try building the testing for RE2 with CMake again.
2023-05-18 junyer Uhh. Fix `LDABSL` for sure this time.
2023-05-18 junyer Try one more time to fix the GNU make build with GCC on Ubuntu.
2023-05-18 junyer For now, stop building the testing for RE2 with CMake.
2023-05-18 junyer Revert "Try `x64-windows-static` for CMake on Windows."
2023-05-18 junyer Try `x64-windows-static` for CMake on Windows.
2023-05-18 junyer Try again to fix the CI workflows.
2023-05-17 junyer Try to fix the CMake CI workflow.
2023-05-17 junyer Try to fix the GNU make CI workflow.
2023-05-17 junyer Fix the GNU make and CMake configurations and CI workflows.
2023-05-17 junyer Copy over the `re2/` and `util/` subdirectories.
2023-05-15 junyer Copy over the Bazel configuration and the workflow for Python releases.
2023-05-15 junyer Copy over the `app/` and `python/` subdirectories.

Created with:
  roll-dep external/re2

* Update WORKSPACE to work with the new RE2.

* Do not build tests with VS2017

RE2 no longer supports VS2017, so we cannot build the tests anymore. We
will continue to make sure the everything else still builds with vs2017.

---------

Co-authored-by: GitHub Actions[bot] <>
Co-authored-by: Steven Perron <stevenperron@google.com>
2023-05-31 13:03:53 -04:00

100 lines
2.9 KiB
Batchfile

:: Copyright (c) 2018 Google LLC.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
::
:: Windows Build Script.
@echo on
set BUILD_ROOT=%cd%
set SRC=%cd%\github\SPIRV-Tools
set BUILD_TYPE=%1
set VS_VERSION=%2
:: Force usage of python 3.6
set PATH=C:\python36;"C:\Program Files\cmake-3.23.1-windows-x86_64\bin";%PATH%
:: #########################################
:: set up msvc build env
:: #########################################
if %VS_VERSION% == 2017 (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
echo "Using VS 2017..."
:: RE2 does not support VS2017, we we must disable tests.
set BUILD_TESTS=NO
) else if %VS_VERSION% == 2019 (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
echo "Using VS 2019..."
)
cd %SRC%
python utils/git-sync-deps --treeless
mkdir build
cd build
:: #########################################
:: Start building.
:: #########################################
echo "Starting build... %DATE% %TIME%"
if "%KOKORO_GITHUB_COMMIT%." == "." (
set BUILD_SHA=%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
) else (
set BUILD_SHA=%KOKORO_GITHUB_COMMIT%
)
set CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\install -GNinja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
:: Build spirv-fuzz
set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON
if "%BUILD_TESTS%" == "NO" (
set CMAKE_FLAGS=-DSPIRV_SKIP_TESTS=ON %CMAKE_FLAGS%
)
cmake %CMAKE_FLAGS% ..
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
echo "Build everything... %DATE% %TIME%"
ninja
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
echo "Build Completed %DATE% %TIME%"
:: This lets us use !ERRORLEVEL! inside an IF ... () and get the actual error at that point.
setlocal ENABLEDELAYEDEXPANSION
:: ################################################
:: Run the tests
:: ################################################
if "%BUILD_TESTS%" NEQ "NO" (
echo "Running Tests... %DATE% %TIME%"
ctest -C %BUILD_TYPE% --output-on-failure --timeout 300
if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL!
echo "Tests Completed %DATE% %TIME%"
)
:: ################################################
:: Install and package.
:: ################################################
ninja install
cd %KOKORO_ARTIFACTS_DIR%
zip -r install.zip install
:: Clean up some directories.
rm -rf %SRC%\build
rm -rf %SRC%\external
exit /b 0