Skip to content

Commit

Permalink
added Windows CI build with ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Jan 12, 2021
1 parent 031dcac commit 37f9467
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_windows_mu4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
if: env.DO_BUILD == 'true'
shell: cmd
run: |
IF ${{ secrets.TELEMETRY_TRACK_ID != 0 }} == true ( SET T_ID=${{ secrets.TELEMETRY_TRACK_ID }} ) ELSE ( SET T_ID="''" )
IF ${{ secrets.TELEMETRY_TRACK_ID != 0 }} == true ( SET T_ID=${{ secrets.TELEMETRY_TRACK_ID }} ) ELSE ( SET T_ID="" )
IF ${{ env.SENTRY_URL != 0 }} == true ( SET C_URL="${{ env.SENTRY_URL }}" ) ELSE ( SET C_URL="" )
build\ci\windows\build.bat -n ${{ github.run_id }} --telemetry %T_ID% --crash_log_url %C_URL%
- name: Generate dump symbols
Expand Down
21 changes: 8 additions & 13 deletions build/ci/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,9 @@ ECHO "BUILD_WIN_PORTABLE: %BUILD_WIN_PORTABLE%"
XCOPY "C:\musescore_dependencies" %CD% /E /I /Y
ECHO "Finished copy dependencies"

SET GENERATOR_NAME=Visual Studio 16 2019
SET MSCORE_STABLE_BUILD="TRUE"

:: TODO We need define paths during image creation
SET "JACK_DIR=C:\Program Files (x86)\Jack"
SET "QT_DIR=C:\Qt\5.15.1"

@REM IF %TARGET_PROCESSOR_BITS% == 32 (
@REM ::SET "PATH=%QT_DIR%\msvc2015\bin;%JACK_DIR%;%PATH%"
@REM ECHO "error: Not installed Qt 32"
@REM EXIT /b 1
@REM ) ELSE (
SET "PATH=%QT_DIR%\msvc2019_64\bin;%JACK_DIR%;%PATH%"
@REM )

:: At the moment not compiling yet.
SET BUILD_VST=OFF
Expand All @@ -67,9 +56,15 @@ SET VST3_SDK_PATH="C:\vst\VST3_SDK"
bash ./build/ci/tools/make_revision_env.sh
SET /p MUSESCORE_REVISION=<%ARTIFACTS_DIR%\env\release_channel.env

CALL msvc_build.bat relwithdebinfo %TARGET_PROCESSOR_BITS% %BUILD_NUMBER% || exit \b 1
CALL msvc_build.bat installrelwithdebinfo %TARGET_PROCESSOR_BITS% %BUILD_NUMBER% || exit \b 1
SET MUSESCORE_BUILD_CONFIG=%MUSESCORE_BUILD_CONFIG%
SET MUSESCORE_BUILD_NUMBER=%BUILD_NUMBER%
SET MUSESCORE_REVISION=%MUSESCORE_REVISION%
SET MUSESCORE_TELEMETRY_ID="%TELEMETRY_TRACK_ID%"
SET MUSESCORE_CRASHREPORT_URL="%CRASH_LOG_SERVER_URL%"
SET MUSESCORE_BUILD_VST=%BUILD_VST%
SET MUSESCORE_VST3_SDK_PATH=%VST3_SDK_PATH%

CALL ninja_build.bat -t relwithdebinfo || exit \b 1

bash ./build/ci/tools/make_release_channel_env.sh -c %MUSESCORE_BUILD_CONFIG%
bash ./build/ci/tools/make_version_env.sh %BUILD_NUMBER%
Expand Down
4 changes: 2 additions & 2 deletions build/ci/windows/dumpsyms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ echo "Generate dump symbols"
GEN_SCRIPT=tools/crashdump/generate_syms.sh
DUMPSYMS_BIN=/c/breakpad_tools/dump_syms.exe
ARTIFACTS_DIR=build.artifacts
BUILD_DIR=msvc.build_x64
BUILD_DIR=build.release
SYMBOLS_DIR=$ARTIFACTS_DIR/symbols
MSCORE_BIN=$BUILD_DIR/src/main/RelWithDebInfo/MuseScore4.pdb
MSCORE_BIN=$BUILD_DIR/src/main/MuseScore4.pdb

echo "GEN_SCRIPT: $GEN_SCRIPT"
echo "DUMPSYMS_BIN: $DUMPSYMS_BIN"
Expand Down
4 changes: 2 additions & 2 deletions build/ci/windows/package.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ SET ARTIFACTS_DIR=build.artifacts
SET BUILD_MODE=""
SET TARGET_PROCESSOR_BITS=64
SET TARGET_PROCESSOR_ARCH=x86_64
SET BUILD_DIR=msvc.build_x64
SET INSTALL_DIR=msvc.install_x64
SET BUILD_DIR=build.release
SET INSTALL_DIR=build.install
SET SIGN_CERTIFICATE_ENCRYPT_SECRET=""
SET SIGN_CERTIFICATE_PASSWORD=""
SET BUILD_WIN_PORTABLE=OFF
Expand Down
11 changes: 11 additions & 0 deletions ninja_build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

ECHO "Setup VS Environment"
SET VSWHERE="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
FOR /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
SET VS_INSTALL_DIR=%%i
)
ECHO "VS_INSTALL_DIR: %VS_INSTALL_DIR%"
CALL "%VS_INSTALL_DIR%\VC\Auxiliary\Build\vcvars64.bat"

bash ./ninja_build.sh %*
26 changes: 21 additions & 5 deletions ninja_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ if [ $SHOW_HELP -eq 1 ]; then
exit 0
fi

cmake --version
echo "ninja version $(ninja --version)"

function do_build() {

BUILD_TYPE=$1
Expand Down Expand Up @@ -66,26 +69,39 @@ case $TARGET in
release)
mkdir -p build.release
cd build.release
do_build RELEASE
;;
do_build Release
;;

debug)
mkdir -p build.release
cd build.release
do_build DEBUG
do_build Debug
;;

relwithdebinfo)
mkdir -p build.release
cd build.release
do_build RelWithDebInfo
;;

install)
mkdir -p build.release
cd build.release
do_build RELEASE
do_build Release
ninja install
;;

installrelwithdebinfo)
mkdir -p build.release
cd build.release
do_build RelWithDebInfo
ninja install
;;

installdebug)
mkdir -p build.debug
cd build.debug
do_build DEBUG
do_build Debug
ninja install
;;

Expand Down

0 comments on commit 37f9467

Please sign in to comment.