From ddea1e4e47065289f41974b98f0ef6b0dbfbf2e4 Mon Sep 17 00:00:00 2001 From: Luke Ceddia Date: Wed, 8 Jan 2020 19:35:38 +1100 Subject: [PATCH] Windows build --- .ci/bootstrap.bat | 38 ++++++++++++++++++++++++++++++++++++++ .ci/compile.bat | 7 +++++++ .github/workflows/run.yml | 15 ++++++++++++--- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .ci/bootstrap.bat create mode 100644 .ci/compile.bat diff --git a/.ci/bootstrap.bat b/.ci/bootstrap.bat new file mode 100644 index 000000000..6f0923311 --- /dev/null +++ b/.ci/bootstrap.bat @@ -0,0 +1,38 @@ +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION + +cd internal\c +set MINGW=mingw32 +IF "%PLATFORM%"=="x64" set MINGW=mingw64 +ren %MINGW% c_compiler +cd ../.. + +echo Building library 'LibQB' +cd internal\c\libqb\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\.. + +echo Building library 'FreeType' +cd internal\c\parts\video\font\ttf\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\..\..\.. + +echo Building library 'Core:FreeGLUT' +cd internal\c\parts\core\os\win +call setup_build.bat +IF ERRORLEVEL 1 exit /b 1 + +cd ..\..\..\..\..\.. + +echo Bootstrapping QB64 +copy internal\source\*.* internal\temp\ >nul +copy source\qb64.ico internal\temp\ >nul +copy source\icon.rc internal\temp\ >nul +cd internal\c +c_compiler\bin\windres.exe -i ..\temp\icon.rc -o ..\temp\icon.o +c_compiler\bin\g++ -mconsole -s -Wfatal-errors -w -Wall qbx.cpp libqb\os\win\libqb_setup.o ..\temp\icon.o -D DEPENDENCY_LOADFONT parts\video\font\ttf\os\win\src.o -D DEPENDENCY_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_ICON -D DEPENDENCY_NO_SCREENIMAGE parts\core\os\win\src.a -lopengl32 -lglu32 -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC -lws2_32 -lwinmm -lgdi32 -o "..\..\qb64_bootstrap.exe" +IF ERRORLEVEL 1 exit /b 1 + diff --git a/.ci/compile.bat b/.ci/compile.bat new file mode 100644 index 000000000..a0ab47ec6 --- /dev/null +++ b/.ci/compile.bat @@ -0,0 +1,7 @@ +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION + +echo From git %GITHUB_SHA:~0,7% > internal\version.txt +qb64_bootstrap.exe -x source\qb64.bas -o qb64.exe +IF ERRORLEVEL 1 exit /b 1 + + diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 713cc6e84..e36d36233 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -6,7 +6,7 @@ on: jobs: macos-build: runs-on: macos-latest - + if: false steps: - uses: actions/checkout@v2 - name: Bootstrap compiler @@ -30,7 +30,7 @@ jobs: linux-build: runs-on: ubuntu-latest - + if: false steps: - uses: actions/checkout@v2 - name: Install dependencies @@ -63,5 +63,14 @@ jobs: if: github.event_name == 'push' run: .ci/deploy.sh lnx - + windows-x86-build: + runs-on: windows-latest + env: + PLATFORM: x86 + steps: + - uses: actions/checkout@v2 + - name: Bootstrap compiler + run: .ci/bootstrap.bat + - name: Compile + run: .ci/compile.bat