Skip to content

Commit

Permalink
update package of dev win artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
VectorworksDeveloper committed Oct 3, 2024
1 parent 9c4e5f5 commit fe178d0
Showing 1 changed file with 48 additions and 27 deletions.
75 changes: 48 additions & 27 deletions .github/workflows/package-dev-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ jobs:
tar -xf xerces-c.zip --strip-components=1
del xerces-c.zip
# Xerces-C - build MD
- name: Xerces-C - configure
working-directory: xerces-c
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX:PATH=libs -DCMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS -O2 -Ob2 -DNDEBUG" -DCMAKE_C_FLAGS="/DWIN32 /D_WINDOWS /W3" -DBUILD_SHARED_LIBS:BOOL=FALSE -Dxmlch-type=wchar_t
# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Boost - setup and build
- name: Boost - prepare
Expand All @@ -50,32 +42,61 @@ jobs:
path: libMvrGdtf

# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- name: libMVRGdtf [MD] - configure
working-directory: libMvrGdtf
run: |
mkdir build_MD
cd build_MD
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=libs -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build"
ren MvrGdtf.vcxproj MvrGdtf_ORG.vcxproj
# libMVRGdtf - build Debug
- name: libMVRGdtf [MD] - Debug - add lib dependencies
working-directory: libMvrGdtf/build_MD
# Produce a batch file to be locally executed to build the library
- name: Generate build batch file
run: |
$xml = [xml](Get-Content MvrGdtf_ORG.vcxproj)
$xml.Project.ItemDefinitionGroup | ForEach-Object {
$node = $xml.CreateElement("AdditionalDependencies", "http://schemas.microsoft.com/developer/msbuild/2003")
$node.InnerText = 'iphlpapi.lib;..\..\xerces-c\build\libs\lib\xerces-c_3D.lib;mdns_cpp\lib\Debug\mdns_cpp.lib;%(AdditionalDependencies)'
$_.Lib.AppendChild($node) | Out-Null
}
Set-Content -Path "MvrGdtf.vcxproj" -Value $xml.OuterXml
# Define the multi-line text
$text = @'
REM ------------------------------------------------
REM ------------------------------------------------
REM
REM Execute this batch in PowerShell
REM
REM Current folder should be the root of libMvrGdtf
REM
REM ------------------------------------------------
call "c:\program files\microsoft visual studio\2022\professional\Common7\Tools\VsDevCmd.bat"
REM ------------------------------------------------
REM Build xerces-c
cd xerces-c
rmdir /s /q build
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX:PATH=libs -DCMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS -O2 -Ob2 -DNDEBUG" -DCMAKE_C_FLAGS="/DWIN32 /D_WINDOWS /W3" -DBUILD_SHARED_LIBS:BOOL=FALSE -Dxmlch-type=wchar_t
msbuild /m ALL_BUILD.vcxproj /p:Configuration=Debug
msbuild /m INSTALL.vcxproj /p:Configuration=Debug
cd ../..
REM ------------------------------------------------
REM libMvrGdtf
cd libMvrGdtf
rmdir /s /q build_MD
mkdir build_MD
cd build_MD
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=libs -DWIN_RUNTIME_LIB=-MD -DXERCES_INCLUDE_PATH="..\xerces-c\build\libs\include;..\xerces\src" -DXERCES_LIB_PATH="..\xerces\build\libs\lib" -DXERCES_ROOT_PATH="..\xerces-c\build"
ren MvrGdtf.vcxproj MvrGdtf_ORG.vcxproj
powershell -Command "$xml = [xml](Get-Content 'MvrGdtf_ORG.vcxproj'); $xml.Project.ItemDefinitionGroup | ForEach-Object { $node = $xml.CreateElement('AdditionalDependencies', 'http://schemas.microsoft.com/developer/msbuild/2003'); $node.InnerText = 'iphlpapi.lib;..\..\xerces-c\build_mt\libs\lib\xerces-c_3.lib;mdns_cpp\lib\MinSizeRel\mdns_cpp.lib;%%(AdditionalDependencies)'; $_.Lib.AppendChild($node) | Out-Null }; Set-Content -Path 'MvrGdtf.vcxproj' -Value $xml.OuterXml"
rm MvrGdtf_ORG.vcxproj
msbuild /m ALL_BUILD.vcxproj /p:Configuration=Debug
msbuild /m INSTALL.vcxproj /p:Configuration=Debug
'@
# Write the text to a file
Set-Content -Path "build_libMVRgdtf.bat" -Value $text
shell: pwsh

# --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- name: Collect Artifact
run: |
dir
Compress-Archive -Path xerces-c,libMvrGdtf,boost -DestinationPath libMVRgdtf-dev.zip
Compress-Archive -Path xerces-c,libMvrGdtf,boost,build_libMVRgdtf.bat -DestinationPath libMVRgdtf-dev.zip
shell: pwsh

- name: Upload artifact
Expand Down

0 comments on commit fe178d0

Please sign in to comment.