Skip to content

Commit 49b0721

Browse files
committed
feature: Experimental support for Windows XP
1 parent 62e8641 commit 49b0721

File tree

28 files changed

+601
-110
lines changed

28 files changed

+601
-110
lines changed

.github/actions/cryptopp/action.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ inputs:
66
description: The cryptopp version to build
77
required: true
88
architecture:
9-
description: The openssl architecture to build
9+
description: The architecture to build
10+
required: true
11+
runtime:
12+
description: If we should use dynamic or static runtime
13+
default: dynamic
14+
toolset:
15+
description: The toolset to use for building
1016
required: true
1117
outputs:
1218
path:
@@ -22,7 +28,7 @@ runs:
2228
- id: cache
2329
uses: actions/cache@v3
2430
with:
25-
key: ${{ runner.os }}-cryptopp-${{ inputs.version }}-${{ inputs.architecture }}
31+
key: ${{ runner.os }}-cryptopp-${{ inputs.version }}-${{ inputs.architecture }}-${{ inputs.runtime }}-${{ inputs.toolset }}
2632
path: |
2733
tmp/cryptopp
2834
@@ -55,14 +61,20 @@ runs:
5561
shell: pwsh
5662
working-directory: tmp/cryptopp
5763

64+
- name: Convert to dynamic runtime
65+
if: inputs.runtime == 'dynamic' && steps.cache.outputs.cache-hit != 'true'
66+
run: |
67+
python ../../build/python/msdev-to-dynamic.py cryptlib.vcxproj
68+
shell: cmd
69+
working-directory: tmp/cryptopp
70+
5871
- name: Build
5972
if: steps.cache.outputs.cache-hit != 'true'
6073
run: |
61-
python ../../build/python/msdev-to-dynamic.py cryptlib.vcxproj
62-
msbuild cryptlib.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
63-
msbuild cryptdll.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
64-
msbuild cryptlib.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
65-
msbuild cryptdll.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
74+
msbuild cryptlib.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }}
75+
msbuild cryptdll.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }}
76+
msbuild cryptlib.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }}
77+
msbuild cryptdll.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }}
6678
working-directory: tmp/cryptopp
6779
shell: cmd
6880

.github/actions/openssl/action.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
architecture:
99
description: The openssl architecture to build
1010
required: true
11+
runtime:
12+
description: The openssl architecture to build
13+
default: dynamic
1114
outputs:
1215
path:
1316
description: The path to the openssl folder
@@ -26,6 +29,11 @@ runs:
2629
} else {
2730
echo "cmd=VC-WIN32" >> $env:GITHUB_OUTPUT
2831
}
32+
if ("${{ inputs.runtime }}" -eq "dynamic") {
33+
echo "shared_flags=" >> $env:GITHUB_OUTPUT
34+
} else {
35+
echo "shared_flags=-MT" >> $env:GITHUB_OUTPUT
36+
}
2937
shell: pwsh
3038

3139
- name: Download openssl
@@ -39,7 +47,7 @@ runs:
3947
- id: cache
4048
uses: actions/cache@v3
4149
with:
42-
key: ${{ runner.os }}-openssl-${{ inputs.version }}-no-shared-${{ inputs.architecture }}
50+
key: ${{ runner.os }}-openssl-${{ inputs.version }}-no-shared-${{ inputs.architecture }}-${{ inputs.runtime }}
4351
path: |
4452
tmp/openssl-${{ inputs.version }}/libcrypto*.*
4553
tmp/openssl-${{ inputs.version }}/libssl*.*
@@ -49,7 +57,7 @@ runs:
4957
5058
- name: Build openssl
5159
run: |
52-
perl Configure ${{ steps.setup.outputs.cmd }} no-asm no-shared
60+
perl Configure ${{ steps.setup.outputs.cmd }} no-asm no-shared ${{ steps.setup.outputs.shared_flags }}
5361
nmake
5462
working-directory: tmp/openssl-${{ inputs.version }}
5563
shell: cmd

.github/actions/post-process-windows-binaries/action.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: The platform to build for
1010
required: true
1111
default: 'x64'
12+
suffix:
13+
description: Optional suffix to add to release
14+
required: true
15+
default: ''
1216
azure-tenant-id:
1317
description: The Azure Active Directory tenant (directory) ID.
1418
required: true
@@ -58,7 +62,7 @@ runs:
5862

5963
- uses: actions/upload-artifact@v4
6064
with:
61-
name: NSCP-${{ inputs.version }}-${{ inputs.platform }}
65+
name: NSCP-${{ inputs.version }}-${{ inputs.platform }}${{ inputs.suffix }}
6266
path: |
6367
tmp/nscp/NSCP-${{ inputs.version }}-${{ inputs.platform }}-docs.zip
6468
tmp/nscp/NSCP-${{ inputs.version }}-${{ inputs.platform }}.zip

.github/actions/protobuf/action.yaml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ inputs:
88
architecture:
99
description: The openssl architecture to build
1010
required: true
11+
runtime:
12+
description: The openssl architecture to build
13+
default: dynamic
14+
toolset:
15+
description: The toolset to use for building
16+
required: true
17+
support_xp:
18+
description: If we should support Windows XP
19+
default: 'false'
1120
outputs:
1221
path:
1322
description: The path to the protobuf folder
@@ -29,7 +38,7 @@ runs:
2938
- id: cache
3039
uses: actions/cache@v3
3140
with:
32-
key: ${{ runner.os }}-protobuf-${{ inputs.version }}-${{ inputs.architecture }}
41+
key: ${{ runner.os }}-protobuf-${{ inputs.version }}-${{ inputs.architecture }}-${{ inputs.runtime }}-${{ inputs.toolset }}
3342
path: |
3443
tmp/protobuf-${{ inputs.version }}/build/Release
3544
@@ -40,6 +49,18 @@ runs:
4049
} else {
4150
echo "platform=Win32" >> $env:GITHUB_OUTPUT
4251
}
52+
if ("${{ inputs.runtime }}" -eq "dynamic") {
53+
echo "shared_libs=TRUE" >> $env:GITHUB_OUTPUT
54+
} else {
55+
echo "shared_libs=FALSE" >> $env:GITHUB_OUTPUT
56+
}
57+
if ("${{ inputs.support_xp }}" -eq "true") {
58+
echo 'additional_options=/p:AdditionalOptions="/DGOOGLE_PROTOBUF_SUPPORT_WINDOWS_XP %(AdditionalOptions)"' >> $env:GITHUB_OUTPUT
59+
} else {
60+
echo "additional_options=" >> $env:GITHUB_OUTPUT
61+
}
62+
63+
4364
shell: pwsh
4465

4566
- name: Prepare
@@ -49,18 +70,18 @@ runs:
4970
shell: cmd
5071
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
5172

52-
- name: CMake x64
73+
- name: CMake
5374
run: |
54-
cmake -DBUILD_SHARED_LIBS=TRUE -G "Visual Studio 17" -T v141 -A ${{ steps.setup.outputs.platform }} ..
75+
cmake -DBUILD_SHARED_LIBS=${{ steps.setup.outputs.shared_libs }} -G "Visual Studio 17" -T ${{ inputs.toolset }} -A ${{ steps.setup.outputs.platform }} ..
5576
working-directory: tmp/protobuf-${{ inputs.version }}/build
5677
shell: cmd
5778

5879
- name: Build
5980
run: |
60-
msbuild libprotobuf.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
61-
msbuild libprotoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
62-
msbuild protoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
63-
msbuild libprotobuf-lite.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }}
81+
echo msbuild libprotobuf.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp ${{ steps.setup.outputs.additional_options }}
82+
msbuild libprotobuf.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp ${{ steps.setup.outputs.additional_options }}
83+
msbuild libprotoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
84+
msbuild protoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=v141_xp
6485
working-directory: tmp/protobuf-${{ inputs.version }}/build
6586
shell: cmd
6687
if: ${{ steps.cache.outputs.cache-hit != 'true' }}

.github/workflows/build-feature.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ jobs:
2020
build-x86:
2121
needs: get-version
2222
uses: ./.github/workflows/build-windows.yml
23-
with:
23+
with:
24+
architecture: x86
25+
version: ${{ needs.get-version.outputs.version }}
26+
secrets:
27+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
28+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
29+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
30+
build-x86-static:
31+
needs: get-version
32+
uses: ./.github/workflows/build-windows-legacy.yml
33+
with:
2434
architecture: x86
2535
version: ${{ needs.get-version.outputs.version }}
2636
secrets:

0 commit comments

Comments
 (0)