diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dbf3d25 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.patch eol=lf diff --git a/.github/workflows/build-angle.yml b/.github/workflows/build-angle.yml new file mode 100644 index 0000000..5584247 --- /dev/null +++ b/.github/workflows/build-angle.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ca7841 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +angle +angle.src +depot_tools +*.zip diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed8a60c --- /dev/null +++ b/README.md @@ -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 diff --git a/angle.patch b/angle.patch new file mode 100644 index 0000000..e7e5236 --- /dev/null +++ b/angle.patch @@ -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++ diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..7749227 --- /dev/null +++ b/build.cmd @@ -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=