Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozeiko committed Dec 18, 2021
0 parents commit 441db2a
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.patch eol=lf
45 changes: 45 additions & 0 deletions .github/workflows/build-angle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

name: build-angle

on:
schedule:
- cron: "0 0 * * 0"
push:
branches:
- main

jobs:
build:
runs-on: windows-2019
steps:

- name: checkout
uses: actions/checkout@v2

- name: build
id: build
shell: cmd
run: call build.cmd

- name: release
id: release
if: steps.build.outputs.ANGLE_COMMIT != ''
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.build.outputs.BUILD_DATE }}
release_name: ${{ steps.build.outputs.BUILD_DATE }}
body: |
[angle commit](https://github.com/google/angle/commit/${{ steps.build.outputs.ANGLE_COMMIT }})
- name: upload
id: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: "angle-${{ steps.build.outputs.BUILD_DATE }}.zip"
asset_name: "angle-${{ steps.build.outputs.BUILD_DATE }}.zip"
asset_content_type: application/zip
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
angle
angle.src
depot_tools
*.zip
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Automatic weekly build of [angle][] OpenGL ES implementation for 64-bit Windows.

Download binary build as zip archive from [latest release][] page.

To build locally run `build.cmd` batch file, make sure you have installed all necessary dependencies (see the beginning of file).

[angle]: http://angleproject.org/
[latest release]: https://github.com/mmozeiko/build-angle/releases/latest
13 changes: 13 additions & 0 deletions angle.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git build/config/win/BUILD.gn build/config/win/BUILD.gn
index 1e76a54cc..eb16f372f 100644
--- build/config/win/BUILD.gn
+++ build/config/win/BUILD.gn
@@ -501,7 +501,7 @@ config("default_crt") {
# defining _DEBUG.
config("release_crt") {
if (is_component_build) {
- cflags = [ "/MD" ]
+ cflags = [ "/MT" ]

if (use_custom_libcxx) {
# On Windows, including libcpmt[d]/msvcprt[d] explicitly links the C++
118 changes: 118 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@echo off
setlocal enabledelayedexpansion

set PATH=%CD%\depot_tools;%PATH%

rem *** check dependencies ***

where /q python.exe || (
echo ERROR: "python.exe" not found
exit /b 1
)

where /q git.exe || (
echo ERROR: "git.exe" not found
exit /b 1
)

where /q curl.exe || (
echo ERROR: "curl.exe" not found
exit /b 1
)

if exist "%ProgramFiles%\7-Zip\7z.exe" (
set SZIP="%ProgramFiles%\7-Zip\7z.exe"
) else (
where /q 7za.exe || (
echo ERROR: 7-Zip installation or "7za.exe" not found
exit /b 1
)
set SZIP=7za.exe
)

for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [16.0^,17.0^) -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath`) do set VS=%%i
if "!VS!" equ "" (
echo ERROR: Visual Studio 2019 installation not found
exit /b 1
)

rem *** download depot_tools ***

if not exist depot_tools (
mkdir depot_tools
pushd depot_tools
curl -LOsf https://storage.googleapis.com/chrome-infra/depot_tools.zip || exit /b 1
%SZIP% x -bb0 -y depot_tools.zip 1>nul 2>nul || exit /b 1
del depot_tools.zip 1>nul 2>nul
popd
)

rem *** downlaod angle source ***

if exist angle.src (
pushd angle.src
pushd build
call git reset --hard HEAD
popd
call git pull --force --no-tags --depth 1
popd
) else (
call git clone --single-branch --no-tags --depth 1 https://chromium.googlesource.com/angle/angle angle.src || exit /b 1
pushd angle.src
python scripts\bootstrap.py || exit /b 1
popd
)

rem *** build angle ***

pushd angle.src

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
call gclient sync || exit /b 1
call gn gen out/Release --args="angle_build_all=false is_debug=false angle_has_frame_capture=false angle_enable_gl=false angle_enable_vulkan=false angle_enable_d3d9=false angle_enable_null=false" || exit /b 1
call git apply -p0 ..\angle.patch || exit /b 1
call autoninja -C out/Release libEGL libGLESv2 libGLESv1_CM || exit /b 1
popd

rem *** prepare output folder ***

mkdir angle
mkdir angle\bin
mkdir angle\lib
mkdir angle\include

copy /y angle.src\.git\refs\heads\main angle\commit.txt 1>nul 2>nul

copy /y "%ProgramFiles(x86)%\Windows Kits\10\Redist\D3D\x64\d3dcompiler_47.dll" angle\bin 1>nul 2>nul

copy /y angle.src\out\Release\libEGL.dll angle\bin 1>nul 2>nul
copy /y angle.src\out\Release\libGLESv1_CM.dll angle\bin 1>nul 2>nul
copy /y angle.src\out\Release\libGLESv2.dll angle\bin 1>nul 2>nul

copy /y angle.src\out\Release\libEGL.dll.lib angle\lib 1>nul 2>nul
copy /y angle.src\out\Release\libGLESv1_CM.dll.lib angle\lib 1>nul 2>nul
copy /y angle.src\out\Release\libGLESv2.dll.lib angle\lib 1>nul 2>nul

xcopy /D /S /I /Q /Y angle.src\include\KHR angle\include\KHR 1>nul 2>nul
xcopy /D /S /I /Q /Y angle.src\include\EGL angle\include\EGL 1>nul 2>nul
xcopy /D /S /I /Q /Y angle.src\include\GLES angle\include\GLES 1>nul 2>nul
xcopy /D /S /I /Q /Y angle.src\include\GLES2 angle\include\GLES2 1>nul 2>nul
xcopy /D /S /I /Q /Y angle.src\include\GLES3 angle\include\GLES3 1>nul 2>nul

del /Q /S angle\include\*.clang-format 1>nul 2>nul

rem *** done ***
rem output is in angle folder

if "%GITHUB_WORKFLOW%" neq "" (
set /p ANGLE_COMMIT=<angle\commit.txt

for /F "skip=1" %%D in ('WMIC OS GET LocalDateTime') do (set LDATE=%%D & goto :dateok)
:dateok
set BUILD_DATE=%LDATE:~0,4%-%LDATE:~4,2%-%LDATE:~6,2%

%SZIP% a -mx=9 angle-%BUILD_DATE%.zip angle || exit /b 1

echo ::set-output name=ANGLE_COMMIT::%ANGLE_COMMIT%
echo ::set-output name=BUILD_DATE::%BUILD_DATE%
)

0 comments on commit 441db2a

Please sign in to comment.