mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
ci: use ninja in Windows builds
This commit is contained in:
parent
fc453c68a7
commit
00e634f1db
6 changed files with 16 additions and 18 deletions
|
|
@ -227,7 +227,7 @@ if [[ $RUNNER_OS == macOS ]]; then
|
||||||
flags+=(-DCPACK_COMMAND_HDIUTIL="$hdiutil_script")
|
flags+=(-DCPACK_COMMAND_HDIUTIL="$hdiutil_script")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ $RUNNER_OS == Windows ]]; then
|
elif [[ $RUNNER_OS == Windows ]] && [[ "$CMAKE_GENERATOR" != *Ninja* ]]; then
|
||||||
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
# Enable MTT, see https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/
|
||||||
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
|
# and https://devblogs.microsoft.com/cppblog/cpp-build-throughput-investigation-and-tune-up/#multitooltask-mtt
|
||||||
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true)
|
buildflags+=(-- -p:UseMultiToolTask=true -p:EnableClServerMode=true)
|
||||||
|
|
|
||||||
18
.github/workflows/desktop-build.yml
vendored
18
.github/workflows/desktop-build.yml
vendored
|
|
@ -320,8 +320,7 @@ jobs:
|
||||||
qt_version: 6.10.*
|
qt_version: 6.10.*
|
||||||
qt_arch: win64_msvc2022_64
|
qt_arch: win64_msvc2022_64
|
||||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||||
cmake_generator: "Visual Studio 17 2022"
|
cmake_generator: Ninja
|
||||||
cmake_generator_platform: x64
|
|
||||||
|
|
||||||
name: ${{matrix.os}} ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
|
name: ${{matrix.os}} ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
|
||||||
needs: configure
|
needs: configure
|
||||||
|
|
@ -338,12 +337,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Add msbuild to PATH
|
# Set relevant environment variables for MSVC, used to ensure ninja + MSVC build correctly together
|
||||||
|
- name: Setup MSVC (Windows)
|
||||||
if: matrix.os == 'Windows'
|
if: matrix.os == 'Windows'
|
||||||
id: add-msbuild
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||||
uses: microsoft/setup-msbuild@v2
|
|
||||||
with:
|
|
||||||
msbuild-architecture: x64
|
|
||||||
|
|
||||||
- name: Setup ccache
|
- name: Setup ccache
|
||||||
if: matrix.use_ccache == 1 && matrix.os == 'macOS'
|
if: matrix.use_ccache == 1 && matrix.os == 'macOS'
|
||||||
|
|
@ -429,7 +426,6 @@ jobs:
|
||||||
MAKE_PACKAGE: '${{matrix.make_package}}'
|
MAKE_PACKAGE: '${{matrix.make_package}}'
|
||||||
PACKAGE_SUFFIX: '${{matrix.package_suffix}}'
|
PACKAGE_SUFFIX: '${{matrix.package_suffix}}'
|
||||||
CMAKE_GENERATOR: ${{matrix.cmake_generator}}
|
CMAKE_GENERATOR: ${{matrix.cmake_generator}}
|
||||||
CMAKE_GENERATOR_PLATFORM: ${{matrix.cmake_generator_platform}}
|
|
||||||
USE_CCACHE: ${{matrix.use_ccache}}
|
USE_CCACHE: ${{matrix.use_ccache}}
|
||||||
VCPKG_DISABLE_METRICS: 1
|
VCPKG_DISABLE_METRICS: 1
|
||||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
||||||
|
|
@ -516,9 +512,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{steps.build.outputs.name}}-PDBs
|
name: ${{steps.build.outputs.name}}-PDBs
|
||||||
path: |
|
path: |
|
||||||
build/cockatrice/Release/*.pdb
|
build/cockatrice/**/*.pdb
|
||||||
build/oracle/Release/*.pdb
|
build/oracle/**/*.pdb
|
||||||
build/servatrice/Release/*.pdb
|
build/servatrice/**/*.pdb
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,8 @@ endif()
|
||||||
|
|
||||||
# Define proper compilation flags
|
# Define proper compilation flags
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics, Debug Symbols
|
# Disable Warning C4251, C++20 compatibility, Multi-threaded Builds, Warn Detection, Unwind Semantics, Debug Symbols, Force Synchronous PDB writes
|
||||||
set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi")
|
set(CMAKE_CXX_FLAGS "/wd4251 /Zc:__cplusplus /std:c++20 /permissive- /W4 /MP /EHsc /Zi /FS")
|
||||||
# Visual Studio: Maximum Optimization, Multi-threaded DLL
|
# Visual Studio: Maximum Optimization, Multi-threaded DLL
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD")
|
set(CMAKE_CXX_FLAGS_RELEASE "/Ox /MD")
|
||||||
# Visual Studio: No Optimization, Multi-threaded Debug DLL
|
# Visual Studio: No Optimization, Multi-threaded Debug DLL
|
||||||
|
|
@ -311,7 +311,9 @@ if(UNIX)
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
|
set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
|
||||||
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "(x64)")
|
# This a generator-agnostic way to determine if the build is 64-bit or 32-bit.
|
||||||
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_SIZEOF_VOID_P.html
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
set(TRICE_IS_64_BIT 1)
|
set(TRICE_IS_64_BIT 1)
|
||||||
else()
|
else()
|
||||||
set(TRICE_IS_64_BIT 0)
|
set(TRICE_IS_64_BIT 0)
|
||||||
|
|
|
||||||
|
|
@ -529,7 +529,7 @@ if(WIN32)
|
||||||
set(qtconf_dest_dir .)
|
set(qtconf_dest_dir .)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/"
|
DIRECTORY "$<TARGET_FILE_DIR:cockatrice>/"
|
||||||
DESTINATION ./
|
DESTINATION ./
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.dll"
|
PATTERN "*.dll"
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ if(WIN32)
|
||||||
list(APPEND libSearchDirs ${QT_LIBRARY_DIR})
|
list(APPEND libSearchDirs ${QT_LIBRARY_DIR})
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/"
|
DIRECTORY "$<TARGET_FILE_DIR:oracle>/"
|
||||||
DESTINATION ./
|
DESTINATION ./
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.dll"
|
PATTERN "*.dll"
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ if(WIN32)
|
||||||
set(qtconf_dest_dir .)
|
set(qtconf_dest_dir .)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CMAKE_BUILD_TYPE}/"
|
DIRECTORY "$<TARGET_FILE_DIR:servatrice>/"
|
||||||
DESTINATION ./
|
DESTINATION ./
|
||||||
FILES_MATCHING
|
FILES_MATCHING
|
||||||
PATTERN "*.dll"
|
PATTERN "*.dll"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue