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'
1120outputs :
1221 path :
1322 description : The path to the protobuf folder
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
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' }}
0 commit comments