Add Windows Ninja CI

This commit is contained in:
Ilya Fedin 2023-11-27 04:44:45 +04:00 committed by John Preston
parent a93340c2e4
commit 1852386ace
4 changed files with 44 additions and 12 deletions

View File

@ -47,6 +47,7 @@ jobs:
strategy:
matrix:
arch: [Win32, x64]
generator: ["", "Ninja Multi-Config"]
env:
UPLOAD_ARTIFACT: "false"
@ -109,19 +110,42 @@ jobs:
cd %TBUILD%
%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent
- name: Read defines.
- name: Read configuration matrix.
shell: bash
run: |
ARTIFACT_NAME="Telegram"
ARCH=""
if [ -n "${{ matrix.arch }}" ]; then
case "${{ matrix.arch }}" in
Win32) ARCH="x86";;
*) ARCH="${{ matrix.arch }}";;
esac
echo "Architecture from matrix: $ARCH"
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.arch }}"
fi
GENERATOR=""
if [ -n "${{ matrix.generator }}" ]; then
GENERATOR="-G \"${{ matrix.generator }}\""
echo "Generator from matrix: $GENERATOR"
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.generator }}"
fi
echo "TDESKTOP_BUILD_GENERATOR=$GENERATOR" >> $GITHUB_ENV
[ -n "$GENERATOR" ] && ARCH=""
echo "TDESKTOP_BUILD_ARCH=$ARCH" >> $GITHUB_ENV
DEFINE=""
if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON"
echo "Define from matrix: $DEFINE"
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}_${{ matrix.defines }}" >> $GITHUB_ENV
else
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}" >> $GITHUB_ENV
ARTIFACT_NAME="${ARTIFACT_NAME}_${{ matrix.defines }}"
fi
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
API="-D TDESKTOP_API_TEST=ON"
if [ $GITHUB_REF == 'refs/heads/nightly' ]; then
echo "Use the open credentials."
@ -142,15 +166,14 @@ jobs:
cd %TBUILD%\%REPO_NAME%\Telegram
call configure.bat ^
${{ matrix.arch }} ^
%TDESKTOP_BUILD_GENERATOR% ^
%TDESKTOP_BUILD_ARCH% ^
%TDESKTOP_BUILD_API% ^
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
-D DESKTOP_APP_NO_PDB=ON ^
%TDESKTOP_BUILD_DEFINE% ^
-DCMAKE_SYSTEM_VERSION=%SDK%
%TDESKTOP_BUILD_DEFINE%
cd ..\out
msbuild -m Telegram.sln /p:Configuration=Debug,Platform=${{ matrix.arch }},DebugSymbols=false,DebugType=none
cmake --build ..\out --config Debug --parallel
- name: Move artifact.
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}

View File

@ -10,8 +10,9 @@ if (APPLE)
else()
cmake_minimum_required(VERSION 3.16)
endif()
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0091 NEW)
if (POLICY CMP0149)
cmake_policy(SET CMP0149 NEW)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

View File

@ -1731,6 +1731,10 @@ endif()
set_target_properties(Telegram PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${output_folder})
if (WIN32)
target_link_libraries(Telegram
PRIVATE
delayimp
)
target_link_options(Telegram
PRIVATE
/DELAYLOAD:secur32.dll
@ -1787,6 +1791,10 @@ if (NOT DESKTOP_APP_DISABLE_AUTOUPDATE AND NOT build_macstore AND NOT build_wins
)
target_include_directories(Updater PRIVATE ${lib_base_loc})
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_link_libraries(Updater
PRIVATE
delayimp
)
target_link_options(Updater
PRIVATE
/DELAYLOAD:user32.dll

2
cmake

@ -1 +1 @@
Subproject commit c2ef75186a82ab89c6f742f6493def1a0d65ffdf
Subproject commit 6b5f4bcc432722269627d4292d71229cf05a81ab