mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
Re-implements Ninja and CCache for Windows Builds (#2051)
* Keeps default compiler flags. * Updates github actions to use ninja and ccache for windows builds. * Fixes ghactions to use MSVC. * Removes commented out CMake code.
This commit is contained in:
parent
06df45efc7
commit
806b9dc84b
14
.github/workflows/generate-builds.yml
vendored
14
.github/workflows/generate-builds.yml
vendored
@ -225,15 +225,24 @@ jobs:
|
||||
readme.txt
|
||||
build-windows:
|
||||
needs: extract-assets
|
||||
runs-on: [self-hosted, Windows, x64]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
choco install ninja
|
||||
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
- name: ccache
|
||||
uses: dcvz/ccache-action@27b9f33213c0079872f064f6b6ba0233dfa16ba2
|
||||
with:
|
||||
key: ${{ runner.os }}-ccache
|
||||
- name: Restore assets
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: assets
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- name: Setup 7-Zip
|
||||
run: |
|
||||
"C:\Program Files\7-Zip" >> $env:GITHUB_PATH
|
||||
@ -241,7 +250,8 @@ jobs:
|
||||
run: |
|
||||
7z x assets.zip -aoa
|
||||
|
||||
cmake -S . -B build-windows -G "Visual Studio 17 2022" -T v142 -A x64 -DCMAKE_BUILD_TYPE:STRING=Release
|
||||
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
||||
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
cmake --build build-windows --target OTRGui --config Release --parallel 10
|
||||
cmake --build build-windows --config Release --parallel 10
|
||||
cd build-windows
|
||||
|
@ -63,38 +63,6 @@ if(NOT CMAKE_BUILD_TYPE )
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Global compiler options
|
||||
################################################################################
|
||||
if(MSVC)
|
||||
# remove default flags provided with CMake for MSVC
|
||||
set(CMAKE_C_FLAGS "")
|
||||
set(CMAKE_C_FLAGS_DEBUG "")
|
||||
set(CMAKE_C_FLAGS_RELEASE "")
|
||||
set(CMAKE_CXX_FLAGS "")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Global linker options
|
||||
################################################################################
|
||||
if(MSVC)
|
||||
# remove default flags provided with CMake for MSVC
|
||||
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Common utils
|
||||
################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user