mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
[GHA] Windows MSVC workflow (#1904)
This commit is contained in:
parent
7b35c793f3
commit
b6d1d8117b
52
.github/workflows/build-windows-msvc.yml
vendored
Normal file
52
.github/workflows/build-windows-msvc.yml
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
name: Build on Windows with MSVC
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build and install zlib
|
||||
run: |
|
||||
powershell -Command "(Invoke-WebRequest -Uri https://raw.githubusercontent.com/r4sas/zlib.install/master/install.bat -OutFile install_zlib.bat)"
|
||||
powershell -Command "(Get-Content install_zlib.bat) | Set-Content install_zlib.bat" # fixing line endings
|
||||
set BUILD_TYPE=Debug
|
||||
./install_zlib.bat
|
||||
set BUILD_TYPE=Release
|
||||
./install_zlib.bat
|
||||
del install_zlib.bat
|
||||
|
||||
- name: Install Boost
|
||||
uses: crazy-max/ghaction-chocolatey@v2
|
||||
with:
|
||||
args: install boost-msvc-14.3
|
||||
|
||||
- name: Install OpenSSL
|
||||
uses: crazy-max/ghaction-chocolatey@v2
|
||||
with:
|
||||
args: install openssl
|
||||
|
||||
- name: Configure
|
||||
working-directory: build
|
||||
run: cmake -DWITH_STATIC=ON .
|
||||
|
||||
- name: Build
|
||||
working-directory: build
|
||||
run: cmake --build . --config Debug -- -m
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: i2pd-msvc
|
||||
path: build/Debug/i2pd.*
|
||||
|
6
.github/workflows/build-windows.yml
vendored
6
.github/workflows/build-windows.yml
vendored
|
@ -8,7 +8,7 @@ defaults:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Building using ${{ matrix.arch }} toolchain
|
||||
name: ${{ matrix.arch }}
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
|
@ -50,7 +50,7 @@ jobs:
|
|||
path: i2pd.exe
|
||||
|
||||
build-cmake:
|
||||
name: Building using ${{ matrix.arch }} toolchain using CMake
|
||||
name: CMake ${{ matrix.arch }}
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
|
@ -89,7 +89,7 @@ jobs:
|
|||
path: build/i2pd.exe
|
||||
|
||||
build-xp:
|
||||
name: Building for Windows XP
|
||||
name: XP
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
|
|
|
@ -147,7 +147,10 @@ else()
|
|||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic")
|
||||
# TODO: The following is incompatible with static build and enabled hardening for OpenWRT.
|
||||
# Multiple definitions of __stack_chk_fail(libssp & libc)
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto -s -ffunction-sections -fdata-sections")
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -flto -s")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -ffunction-sections -fdata-sections")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-Wl,--gc-sections") # -flto is added from above
|
||||
|
||||
# check for c++17 & c++11 support
|
||||
|
|
Loading…
Reference in a new issue