diff --git a/.github/workflows/build-test-windows.yml b/.github/workflows/build-test-windows.yml
index 9f21cd7682e7..204ed976cb38 100644
--- a/.github/workflows/build-test-windows.yml
+++ b/.github/workflows/build-test-windows.yml
@@ -46,6 +46,7 @@ jobs:
env:
BUILD_C_SHARP: ${{ matrix.cxx_compiler == 'msvc-2022' && matrix.build_system == 'CMake' }}
PYTEST_C_SHARP_ARGS: --run-c-sharp-samples --csharp-sample-dir=..\source\x64\${{ matrix.config }}
+ VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
steps:
- name: Checkout
@@ -91,7 +92,7 @@ jobs:
uses: actions/cache@v5
id: vcpkg-cache
with:
- key: vcpkg-cache-${{ matrix.vcpkg-version }}
+ key: vcpkg-cache-${{ matrix.vcpkg-version }}-${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
path: |
C:\vcpkg\*
@@ -104,7 +105,7 @@ jobs:
- name: Update vcpkg packages
run: |
- .\thirdparty\install.bat --write-s3
+ .\thirdparty\install.bat --write-s3 --use-s3-asset-provider
- name: Vcpkg integrate install
working-directory: C:\vcpkg
@@ -188,6 +189,7 @@ jobs:
env:
GETTEXT_ROOT: C:\msys64_meshlib_mrbind\clang64
VCPKG_ROOT: C:\vcpkg
+ VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
# `|| exit /b 1` is used instead of `if errorlevel 1 exit 1`
# because the latter can miss exit codes inside parenthesized IF
# blocks in cmd.exe (e.g. it failed to catch a ninja build failure).
@@ -195,16 +197,16 @@ jobs:
if ${{ fromJSON('["1==0", "1==1"]')[matrix.build_system == 'CMake'] }} (
call "${{matrix.vc-path}}\Common7\Tools\VsDevCmd.bat" -arch=amd64 ${{ fromJSON('["", "-vcvars_ver=14.2"]')[matrix.cxx_compiler == 'msvc-2019'] }} || exit /b 1
cmake --version || exit /b 1
- cmake -B source\TempOutput -GNinja -DCMAKE_BUILD_TYPE=${{matrix.config}} -DMESHLIB_BUILD_GENERATED_C_BINDINGS=${{ fromJSON('["OFF", "ON"]')[inputs.mrbind_c] }} || exit /b 1
+ cmake -B source\TempOutput -GNinja -DCMAKE_BUILD_TYPE=${{matrix.config}} -DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% -DMESHLIB_BUILD_GENERATED_C_BINDINGS=${{ fromJSON('["OFF", "ON"]')[inputs.mrbind_c] }} || exit /b 1
cmake --build source\TempOutput -j || exit /b 1
if not exist source\x64 mkdir source\x64 || exit /b 1
xcopy source\TempOutput\bin\* source\x64\${{matrix.config}}\* /s /e /i /Y || exit /b 1
) else (
- msbuild -m source\MeshLib.sln -p:Configuration=${{ matrix.config }}${{ fromJSON('["", ";PlatformToolset=v142"]')[matrix.cxx_compiler == 'msvc-2019'] }} || exit /b 1
+ msbuild -m source\MeshLib.sln -p:Configuration=${{ matrix.config }} -p:VcpkgTriplet=%VCPKG_TARGET_TRIPLET%${{ fromJSON('["", ";PlatformToolset=v142"]')[matrix.cxx_compiler == 'msvc-2019'] }} || exit /b 1
)
- name: Generate and build Python bindings
- if: ${{inputs.mrbind}}
+ if: ${{inputs.mrbind && matrix.vcpkg_triplet != 'x64-windows-meshlib-iterator-debug'}}
shell: cmd
# Note that `\` doesn't work here as a line continuation, and will lead to weird errors.
run: |
@@ -238,12 +240,13 @@ jobs:
$xslt.Transform("_report_nunit.xml", "unit_tests_report_nunit.xml")
- name: Python Sanity Tests
+ if: ${{matrix.vcpkg_triplet != 'x64-windows-meshlib-iterator-debug'}}
timeout-minutes: 8
working-directory: source\x64\${{ matrix.config }}
run: py -3 ..\..\..\scripts\run_python_test_script.py -d '..\test_python' -a ' --junit-xml=../unit_tests_report_pytest.xml'
- name: Python Regression Tests
- if: ${{ inputs.internal_build }}
+ if: ${{inputs.internal_build && matrix.vcpkg_triplet != 'x64-windows-meshlib-iterator-debug'}}
uses: ./.github/actions/python-regression-tests
with:
build_config: ${{ matrix.config }}
@@ -283,12 +286,13 @@ jobs:
if: ${{ matrix.config == 'Release' }} # debug builds not supported due to missing file 'tbb12_debug.lib'
env:
VCPKG_ROOT: C:\vcpkg
+ VCPKG_TARGET_TRIPLET: ${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
run: |
& $env:CMAKE_EXE `
-S examples/cpp-examples `
-B cpp-examples-build `
- -D MESHLIB_INCLUDE_DIRS="$pwd/source;$pwd/thirdparty/parallel-hashmap;$env:VCPKG_ROOT/installed/x64-windows-meshlib/include;$env:VCPKG_ROOT/installed/x64-windows-meshlib/include/eigen3" `
- -D MESHLIB_LIB_DIRS="$pwd/source/x64/${{ matrix.config }};$env:VCPKG_ROOT/installed/x64-windows-meshlib/lib"
+ -D MESHLIB_INCLUDE_DIRS="$pwd/source;$pwd/thirdparty/parallel-hashmap;$env:VCPKG_ROOT/installed/$env:VCPKG_TARGET_TRIPLET/include;$env:VCPKG_ROOT/installed/$env:VCPKG_TARGET_TRIPLET/include/eigen3" `
+ -D MESHLIB_LIB_DIRS="$pwd/source/x64/${{ matrix.config }};$env:VCPKG_ROOT/installed/$env:VCPKG_TARGET_TRIPLET/lib"
& $env:CMAKE_EXE `
--build cpp-examples-build `
--config ${{ matrix.config }} `
@@ -310,7 +314,7 @@ jobs:
# https://github.com/actions/download-artifact#maintaining-file-permissions-and-case-sensitive-files
- name: Archive files
if: ${{ inputs.upload_artifacts && matrix.cxx_compiler == 'msvc-2019' && matrix.build_system == 'CMake' }}
- run: tar -a -c -f MREDist_${{ matrix.config }}.zip ./source/x64/${{matrix.config}}
+ run: tar -a -c -f MREDist_${{ matrix.upload_name || matrix.config }}.zip ./source/x64/${{ matrix.config }}
- name: Archive generated C headers
if: ${{ inputs.upload_artifacts && matrix.cxx_compiler == 'msvc-2019' && matrix.build_system == 'CMake' && matrix.config == 'Release' && inputs.mrbind_c }}
@@ -320,8 +324,8 @@ jobs:
if: ${{ inputs.upload_artifacts && matrix.cxx_compiler == 'msvc-2019' && matrix.build_system == 'CMake' }}
uses: actions/upload-artifact@v7
with:
- name: WindowsArchive_${{matrix.config}}
- path: MREDist_${{matrix.config}}.zip
+ name: WindowsArchive_${{ matrix.upload_name || matrix.config }}
+ path: MREDist_${{ matrix.upload_name || matrix.config }}.zip
retention-days: 1
- name: Collect artifact stats
@@ -330,7 +334,7 @@ jobs:
uses: ./.github/actions/collect-artifact-stats
with:
artifact_path: ${{ github.workspace }}
- artifact_glob: MREDist_${{matrix.config}}.zip
+ artifact_glob: MREDist_${{ matrix.upload_name || matrix.config }}.zip
stats_file_suffix: -${{ steps.collect-runner-stats.outputs.job_id }}
- name: Upload MeshLibC2 headers archive
diff --git a/.github/workflows/matrix/windows-finalize-release-config.json b/.github/workflows/matrix/windows-finalize-release-config.json
index 1cbefd41efa0..db8c08e098af 100644
--- a/.github/workflows/matrix/windows-finalize-release-config.json
+++ b/.github/workflows/matrix/windows-finalize-release-config.json
@@ -5,6 +5,7 @@
"config": "Debug",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -17,12 +18,27 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
"CUDA-MAJOR": "11",
"CUDA-MINOR": "4",
"test_artifacts_path": "windows/windows-2019/Release"
+ },
+ {
+ "cxx_compiler": "msvc-2019",
+ "config": "Debug",
+ "build_system": "CMake",
+ "vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib-iterator-debug",
+ "upload_name": "Debug-IteratorDebug",
+ "runner": ["windows-2025"],
+ "vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
+ "CUDA-VERSION": "11.4.2.47141",
+ "CUDA-MAJOR": "11",
+ "CUDA-MINOR": "4",
+ "test_artifacts_path": "windows/windows-2019/Debug-IteratorDebug"
}
]
}
diff --git a/.github/workflows/matrix/windows-full-config.json b/.github/workflows/matrix/windows-full-config.json
index 0d8422bac590..546ec99a6819 100644
--- a/.github/workflows/matrix/windows-full-config.json
+++ b/.github/workflows/matrix/windows-full-config.json
@@ -5,6 +5,7 @@
"config": "Debug",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -17,6 +18,7 @@
"config": "Release",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -29,6 +31,7 @@
"config": "Debug",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -41,6 +44,7 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -53,6 +57,7 @@
"config": "Debug",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -65,6 +70,7 @@
"config": "Release",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -77,6 +83,7 @@
"config": "Debug",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -89,12 +96,27 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
"CUDA-MAJOR": "11",
"CUDA-MINOR": "4",
"test_artifacts_path": "windows/windows-2019/Release"
+ },
+ {
+ "cxx_compiler": "msvc-2019",
+ "config": "Debug",
+ "build_system": "CMake",
+ "vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib-iterator-debug",
+ "upload_name": "Debug-IteratorDebug",
+ "runner": ["windows-2025"],
+ "vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
+ "CUDA-VERSION": "11.4.2.47141",
+ "CUDA-MAJOR": "11",
+ "CUDA-MINOR": "4",
+ "test_artifacts_path": "windows/windows-2019/Debug-IteratorDebug"
}
]
}
diff --git a/.github/workflows/matrix/windows-minimal-config.json b/.github/workflows/matrix/windows-minimal-config.json
index 4d29ac1a08f5..6acf74d5dde5 100644
--- a/.github/workflows/matrix/windows-minimal-config.json
+++ b/.github/workflows/matrix/windows-minimal-config.json
@@ -5,6 +5,7 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -17,6 +18,7 @@
"config": "Debug",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -29,12 +31,27 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
"CUDA-MAJOR": "12",
"CUDA-MINOR": "0",
"test_artifacts_path": "windows/windows-2022/Debug"
+ },
+ {
+ "cxx_compiler": "msvc-2019",
+ "config": "Debug",
+ "build_system": "CMake",
+ "vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib-iterator-debug",
+ "upload_name": "Debug-IteratorDebug",
+ "runner": ["windows-2025"],
+ "vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
+ "CUDA-VERSION": "11.4.2.47141",
+ "CUDA-MAJOR": "11",
+ "CUDA-MINOR": "4",
+ "test_artifacts_path": "windows/windows-2019/Debug-IteratorDebug"
}
]
}
diff --git a/.github/workflows/matrix/windows-standard-config.json b/.github/workflows/matrix/windows-standard-config.json
index cf2278699e7c..346591e1673e 100644
--- a/.github/workflows/matrix/windows-standard-config.json
+++ b/.github/workflows/matrix/windows-standard-config.json
@@ -5,6 +5,7 @@
"config": "Debug",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -17,6 +18,7 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "11.4.2.47141",
@@ -29,6 +31,7 @@
"config": "Release",
"build_system": "MSBuild",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
@@ -41,12 +44,27 @@
"config": "Release",
"build_system": "CMake",
"vcpkg-version": "__VCPKG_VERSION_VS22__",
+ "vcpkg_triplet": "x64-windows-meshlib",
"runner": ["windows-2025"],
"vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
"CUDA-VERSION": "12.0.1.52833",
"CUDA-MAJOR": "12",
"CUDA-MINOR": "0",
"test_artifacts_path": "windows/windows-2022/Release"
+ },
+ {
+ "cxx_compiler": "msvc-2019",
+ "config": "Debug",
+ "build_system": "CMake",
+ "vcpkg-version": "__VCPKG_VERSION_VS19__",
+ "vcpkg_triplet": "x64-windows-meshlib-iterator-debug",
+ "upload_name": "Debug-IteratorDebug",
+ "runner": ["windows-2025"],
+ "vc-path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
+ "CUDA-VERSION": "11.4.2.47141",
+ "CUDA-MAJOR": "11",
+ "CUDA-MINOR": "4",
+ "test_artifacts_path": "windows/windows-2019/Debug-IteratorDebug"
}
]
}
diff --git a/.github/workflows/prepare-images.yml b/.github/workflows/prepare-images.yml
index 50cd6cff9407..ea3d9466db1e 100644
--- a/.github/workflows/prepare-images.yml
+++ b/.github/workflows/prepare-images.yml
@@ -147,10 +147,16 @@ jobs:
strategy:
fail-fast: false
matrix:
- runner: [ windows-2025 ]
+ vs: [ vs2019, vs2022 ]
include:
- - runner: windows-2025
+ - vs: vs2022
+ runner: windows-2025
vcpkg-version: ${{ inputs.vs22_vcpkg_version }}
+ vcpkg_triplet: x64-windows-meshlib
+ - vs: vs2019
+ runner: windows-2025
+ vcpkg-version: ${{ inputs.vs19_vcpkg_version }}
+ vcpkg_triplet: x64-windows-meshlib-iterator-debug
steps:
- name: Setup vcpkg
working-directory: C:\vcpkg
@@ -173,4 +179,7 @@ jobs:
aws-region: us-east-1
- name: Build and cache vcpkg
- run: .\thirdparty\install.bat --write-s3
+ env:
+ VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
+ run: |
+ .\thirdparty\install.bat --write-s3 --use-s3-asset-provider
diff --git a/.github/workflows/test-distribution.yml b/.github/workflows/test-distribution.yml
index 88dc791be8e6..06237cf9f6fc 100644
--- a/.github/workflows/test-distribution.yml
+++ b/.github/workflows/test-distribution.yml
@@ -273,6 +273,18 @@ jobs:
if: ${{ inputs.test_windows }}
runs-on: windows-2025
timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - dist_pattern: "MeshLibDist_*[!-]*.zip"
+ config: Release
+ app_subdir: Release
+ idl: 0
+ - dist_pattern: "MeshLibDist_*-IteratorDebug.zip"
+ config: Debug
+ app_subdir: Debug
+ idl: 2
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -283,14 +295,14 @@ jobs:
continue-on-error: true
run: |
echo ${{ secrets.GH_TOKEN }} | gh auth login --with-token
- gh release download ${{ inputs.release_tag }} --pattern "MeshLibDist*.zip" --repo ${{ github.repository }}
+ gh release download ${{ inputs.release_tag }} --pattern "${{ matrix.dist_pattern }}" --repo ${{ github.repository }}
- name: Unpack Distributive
id: unpack-dist
run: |
if (Test-Path MeshLibDist*.zip) {
Expand-Archive -Path (Get-ChildItem MeshLibDist*.zip) -DestinationPath C:\meshlib-built
- Write-Output "C:\\meshlib-built\\install\\app\\Release" >> $env:GITHUB_PATH
+ Write-Output "C:\\meshlib-built\\install\\app\\${{ matrix.app_subdir }}" >> $env:GITHUB_PATH
Write-Output "dist_found=true" >> $env:GITHUB_OUTPUT
} else {
Write-Output "dist_found=false" >> $env:GITHUB_OUTPUT
@@ -312,9 +324,10 @@ jobs:
run: |
cmake -S . -B build `
-D MESHLIB_INCLUDE_DIRS=$env:DIST_DIR\install\include `
- -D MESHLIB_LIB_DIRS=$env:DIST_DIR\install\lib\Release
- cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
- .\build\Release\MeshModification.exe
+ -D MESHLIB_LIB_DIRS=$env:DIST_DIR\install\lib\${{ matrix.config }} `
+ -D CMAKE_CXX_FLAGS="/D_ITERATOR_DEBUG_LEVEL=${{ matrix.idl }} /DMR_ITERATOR_DEBUG_LEVEL=${{ matrix.idl }}"
+ cmake --build build --config ${{ matrix.config }} --parallel $env:NUMBER_OF_PROCESSORS
+ .\build\${{ matrix.config }}\MeshModification.exe
- name: Build C examples
if: ${{ always() && steps.unpack-dist.outputs.dist_found == 'true' }}
@@ -324,6 +337,6 @@ jobs:
run: |
cmake -S . -B build `
-D MESHLIB_INCLUDE_DIRS=$env:DIST_DIR\install\include `
- -D MESHLIB_LIB_DIRS=$env:DIST_DIR\install\lib\Release
- cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS
- .\build\Release\MeshModification.exe
+ -D MESHLIB_LIB_DIRS=$env:DIST_DIR\install\lib\${{ matrix.config }}
+ cmake --build build --config ${{ matrix.config }} --parallel $env:NUMBER_OF_PROCESSORS
+ .\build\${{ matrix.config }}\MeshModification.exe
diff --git a/.github/workflows/update-win-version.yml b/.github/workflows/update-win-version.yml
index bb52de6084ef..2215f182d569 100644
--- a/.github/workflows/update-win-version.yml
+++ b/.github/workflows/update-win-version.yml
@@ -14,8 +14,22 @@ jobs:
update-win-version:
timeout-minutes: 60
runs-on: windows-2025
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - vcpkg_triplet: x64-windows-meshlib
+ extract_release: MREDist_Release.zip
+ extract_debug: MREDist_Debug.zip
+ output_zip: MeshLibDist.zip
+ artifact_name: DistributivesWin
+ - vcpkg_triplet: x64-windows-meshlib-iterator-debug
+ extract_debug: MREDist_Debug-IteratorDebug.zip
+ output_zip: MeshLibDist-IteratorDebug.zip
+ artifact_name: DistributivesWin-IteratorDebug
env:
vs19_vcpkg_version: ${{ inputs.vs19_vcpkg_version }}
+ VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet || 'x64-windows-meshlib' }}
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -32,12 +46,11 @@ jobs:
uses: actions/cache@v5
id: vcpkg-cache
with:
- key: vcpkg-cache-${{env.vs19_vcpkg_version}}
+ key: vcpkg-cache-${{ env.vs19_vcpkg_version }}-${{ matrix.vcpkg_triplet }}
path: |
C:\vcpkg\*
- name: Update vcpkg packages
- # NOTE: This step (thirdparty/install.bat) is the only one keeping us from using github runner for this job
run: |
.\thirdparty\install.bat
@@ -49,33 +62,44 @@ jobs:
- name: Extract Windows Binaries
run: |
- tar -xvzf MREDist_Release.zip
- tar -xvzf MREDist_Debug.zip
+ if ("${{ matrix.extract_release }}") {
+ tar -xvzf ${{ matrix.extract_release }}
+ }
+ tar -xvzf ${{ matrix.extract_debug }}
tar -xvzf MeshLibC2Headers.zip
- name: Make Install Folder
- run: py -3.10 scripts\make_install_folder.py ${{ inputs.app_version }}
+ run: py -3.10 scripts\make_install_folder.py ${{ inputs.app_version }} ${{ matrix.vcpkg_triplet }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
- name: Archive Distribution
- run: py -3.10 scripts\zip_distribution.py install example_plugin MeshLibDist.zip
+ run: py -3.10 scripts\zip_distribution.py install example_plugin ${{ matrix.output_zip }}
- name: Test Example Plugin # call it after archive not to pack build results
+ env:
+ IDL: ${{ matrix.vcpkg_triplet == 'x64-windows-meshlib-iterator-debug' && '2' || '0' }}
run: |
- msbuild -m example_plugin\example_plugin.sln -p:Configuration=Debug
- msbuild -m example_plugin\example_plugin.sln -p:Configuration=Release
+ msbuild -m example_plugin\example_plugin.sln -p:Configuration=Debug -p:MeshLibIteratorDebugLevel=$env:IDL
+ if ("${{ matrix.extract_release }}") {
+ msbuild -m example_plugin\example_plugin.sln -p:Configuration=Release
+ }
- name: Upload Windows Distribution
uses: actions/upload-artifact@v7
with:
- name: DistributivesWin
- path: MeshLibDist.zip
+ name: ${{ matrix.artifact_name }}
+ path: ${{ matrix.output_zip }}
retention-days: 1
+ cleanup-win-archives:
+ needs: update-win-version
+ if: always()
+ runs-on: aws-micro
+ steps:
- name: Delete Windows Binaries Archive
uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0
with:
name: WindowsArchive*
- failOnError: false
\ No newline at end of file
+ failOnError: false
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69e33798056c..8ec5b76b7a73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,6 +78,15 @@ IF(MR_EMSCRIPTEN)
set(MESHLIB_BUILD_MESHCONV OFF)
ENDIF()
+# Python modules are incompatible with _ITERATOR_DEBUG_LEVEL=2 because the
+# vcpkg python3 port ships pre-built Release binaries (IDL=0) that cannot load
+# .pyd files built against a different debug CRT (error 1114 on Windows).
+# Only affects Debug builds; Release with this triplet uses IDL=0 (the default).
+IF(DEFINED VCPKG_TARGET_TRIPLET AND VCPKG_TARGET_TRIPLET MATCHES ".*iterator-debug.*" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(MESHLIB_PYTHON_SUPPORT OFF)
+ set(MESHLIB_BUILD_PYTHON_MODULES OFF)
+ENDIF()
+
set(MESHLIB_THIRDPARTY_DIR "${PROJECT_SOURCE_DIR}/thirdparty")
set(MESHLIB_THIRDPARTY_ROOT_DIR "${PROJECT_SOURCE_DIR}" CACHE PATH "Thirdparty library location")
diff --git a/cmake/Modules/CompilerOptions.cmake b/cmake/Modules/CompilerOptions.cmake
index 1df0ee1168aa..1a7d8dbafce8 100644
--- a/cmake/Modules/CompilerOptions.cmake
+++ b/cmake/Modules/CompilerOptions.cmake
@@ -119,7 +119,15 @@ ENDIF()
IF(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
- add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
+ # Set _ITERATOR_DEBUG_LEVEL based on vcpkg triplet
+ # default val is 0 for backward compatibility
+ IF(DEFINED VCPKG_TARGET_TRIPLET AND VCPKG_TARGET_TRIPLET MATCHES ".*iterator-debug.*")
+ add_definitions(-D_ITERATOR_DEBUG_LEVEL=2)
+ add_definitions(-DMR_ITERATOR_DEBUG_LEVEL=2)
+ ELSE()
+ add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
+ add_definitions(-DMR_ITERATOR_DEBUG_LEVEL=0)
+ ENDIF()
ENDIF()
IF(NOT MSVC)
diff --git a/example_plugin/example_plugin.vcxproj b/example_plugin/example_plugin.vcxproj
index f0449c9ff762..ee82d48a7bb1 100644
--- a/example_plugin/example_plugin.vcxproj
+++ b/example_plugin/example_plugin.vcxproj
@@ -57,6 +57,11 @@
+
+
+ 0
+
$(SolutionDir)TempOutput\$(Platform)\$(Configuration)\
@@ -67,7 +72,7 @@
Level3
true
- _ITERATOR_DEBUG_LEVEL=0;_DEBUG;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;EXAMPLEPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ _ITERATOR_DEBUG_LEVEL=$(MeshLibIteratorDebugLevel);MR_ITERATOR_DEBUG_LEVEL=$(MeshLibIteratorDebugLevel);_DEBUG;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;EXAMPLEPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
true
NotUsing
pch.h
@@ -96,7 +101,7 @@
true
true
true
- NDEBUG;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;EXAMPLEPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
+ _ITERATOR_DEBUG_LEVEL=0;MR_ITERATOR_DEBUG_LEVEL=0;NDEBUG;IMGUI_DISABLE_OBSOLETE_FUNCTIONS;EXAMPLEPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
true
NotUsing
pch.h
diff --git a/scripts/make_install_folder.py b/scripts/make_install_folder.py
index ab1bdd4502b7..2eeeb290dc0e 100644
--- a/scripts/make_install_folder.py
+++ b/scripts/make_install_folder.py
@@ -21,16 +21,19 @@
not_app_extentions = ['.lib','.obj','.pdb','.obj','.exp','.iobj','.ipdb']
def vcpkg_dir():
- vcpkg_exe_dir = ""
+ vcpkg_triplet = "x64-windows-meshlib"
if len(sys.argv) > 2:
- vcpkg_exe_dir = sys.argv[2]
+ vcpkg_triplet = sys.argv[2]
+ vcpkg_exe_dir = ""
+ if len(sys.argv) > 3:
+ vcpkg_exe_dir = sys.argv[3]
else:
vcpkg_exe_dir = os.popen("where vcpkg").read().strip()
if "vcpkg.exe" not in vcpkg_exe_dir:
vcpkg_exe_dir = "C:\\vcpkg"
else:
vcpkg_exe_dir = os.path.dirname( vcpkg_exe_dir )
- return os.path.join(os.path.join(vcpkg_exe_dir, "installed"),"x64-windows-meshlib")
+ return os.path.join(os.path.join(vcpkg_exe_dir, "installed"), vcpkg_triplet)
vcpkg_directory = vcpkg_dir()
diff --git a/scripts/mrbind/generate.mk b/scripts/mrbind/generate.mk
index e960e3840fc0..c5a41fe62a28 100644
--- a/scripts/mrbind/generate.mk
+++ b/scripts/mrbind/generate.mk
@@ -148,6 +148,11 @@ $(error Can't find vcpkg! The path to it should be stored in `$(vcpkg_marker_pat
endif
$(info Using vcpkg at: $(VCPKG_DIR))
endif
+
+# Try to read the triplet from the `VCPKG_DEFAULT_TRIPLET` env variable if it's set.
+VCPKG_TRIPLET := $(if $(VCPKG_DEFAULT_TRIPLET),$(VCPKG_DEFAULT_TRIPLET),x64-windows-meshlib)
+$(info Using vcpkg triplet: $(VCPKG_TRIPLET))
+
else
VCPKG_DIR = $(error We're only using vcpkg on Windows)
endif
@@ -190,7 +195,7 @@ MRBIND_GEN_CSHARP_EXE = $(MRBIND_EXE)_gen_csharp
# Look for MeshLib dependencies relative to this. On Linux should point to the project root, because that's where `./include` and `./lib` are.
ifneq ($(IS_WINDOWS),)
-DEPS_BASE_DIR := $(VCPKG_DIR)/installed/x64-windows-meshlib
+DEPS_BASE_DIR := $(VCPKG_DIR)/installed/$(VCPKG_TRIPLET)
DEPS_LIB_DIR := $(DEPS_BASE_DIR)/$(if $(filter Debug,$(VS_MODE)),debug/)lib
else
DEPS_BASE_DIR := .
diff --git a/source/common.props b/source/common.props
index 72911f5b189e..dcb44af18f9e 100644
--- a/source/common.props
+++ b/source/common.props
@@ -15,7 +15,9 @@
- _ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
+
+ _ITERATOR_DEBUG_LEVEL=2;MR_ITERATOR_DEBUG_LEVEL=2;%(PreprocessorDefinitions)
+ _ITERATOR_DEBUG_LEVEL=0;MR_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
diff --git a/thirdparty/asset-provider-s3.bat b/thirdparty/asset-provider-s3.bat
new file mode 100644
index 000000000000..8a13afcf52f0
--- /dev/null
+++ b/thirdparty/asset-provider-s3.bat
@@ -0,0 +1,58 @@
+@echo off
+setlocal enabledelayedexpansion
+set "url=%~1"
+set "sha512=%~2"
+
+REM Destination path: normally %3. If the URL was NOT quoted, cmd splits ?full_index=1 into
+REM extra tokens and %3 becomes the hash — the real path is then %4. Pick first arg that has \.
+set "dst=%~3"
+echo.%~3| findstr "\\" >nul 2>&1 || set "dst=%~4"
+if not defined dst set "dst=%~3"
+
+REM convert forward → backward slashes for Windows
+set "_dst=%dst:/=\%"
+
+REM filename + extension only (e.g. openssl-openssl-....patch.6124.part)
+for %%F in ("%_dst%") do set "DST_ARG=%%~nxF"
+
+
+REM vcpkg often spawns this script with a minimal PATH; interactive shells still find aws
+set "AWS_EXE="
+if exist "%ProgramFiles%\Amazon\AWSCLIV2\aws.exe" set "AWS_EXE=%ProgramFiles%\Amazon\AWSCLIV2\aws.exe"
+if not defined AWS_EXE if exist "%ProgramFiles(x86)%\Amazon\AWSCLIV2\aws.exe" set "AWS_EXE=%ProgramFiles(x86)%\Amazon\AWSCLIV2\aws.exe"
+if not defined AWS_EXE set "AWS_EXE=aws"
+
+set "fn=!DST_ARG!"
+if /I "!fn:~-5!"==".part" set "fn=!fn:~0,-5!"
+set "DST_KEY="
+if defined fn for %%a in ("!fn!") do set "DST_KEY=%%~na"
+
+REM S3 object key = URL basename (last path segment)
+for %%i in (%url%) do set "basename=%%~nxi"
+
+echo url: %url%
+echo dst: %_dst%
+
+echo S3 key1: !DST_KEY!
+echo S3 key2: %basename%
+echo S3 cmd1: "%AWS_EXE%" s3 cp "s3://vcpkg-export/downloads/!DST_KEY!" "%_dst%" --no-sign-request
+echo S3 cmd2: "%AWS_EXE%" s3 cp "s3://vcpkg-export/downloads/%basename%" "%_dst%" --no-sign-request
+
+if defined DST_KEY (
+ "%AWS_EXE%" s3 cp "s3://vcpkg-export/downloads/!DST_KEY!" "%_dst%" --no-sign-request
+ if not errorlevel 1 if exist "%_dst%" (
+ echo Fetched from S3 ^(key1 / dst^): !DST_KEY!
+ exit /b 0
+ )
+)
+
+if defined basename if /I not "!basename!"=="!DST_KEY!" (
+ "%AWS_EXE%" s3 cp "s3://vcpkg-export/downloads/%basename%" "%_dst%" --no-sign-request
+ if not errorlevel 1 if exist "%_dst%" (
+ echo Fetched from S3 ^(key2 / url^): %basename%
+ exit /b 0
+ )
+)
+
+echo S3 download failed.
+exit /b 1
diff --git a/thirdparty/install.bat b/thirdparty/install.bat
index e36e659cfc21..2adf5f04b5da 100644
--- a/thirdparty/install.bat
+++ b/thirdparty/install.bat
@@ -1,11 +1,17 @@
@echo off
setlocal enabledelayedexpansion
-REM options: use --write-s3 to push vcpkg binary cache to S3
+REM options:
+REM --write-s3 push vcpkg binary cache to S3 (needs AWS credentials)
+REM --use-s3-asset-provider fetch vcpkg download assets via thirdparty\asset-provider-s3.bat (S3 then curl).
+REM Use only when pinned to an older vcpkg whose upstream download URLs are stale or broken;
+REM newer vcpkg ports usually do not need this.
+
REM The VCPKG_TAG variable represents the S3 folder and may not always exist in S3
REM use "aws s3 ls s3://vcpkg-export/" to list all available tags
-set VCPKG_DEFAULT_TRIPLET=x64-windows-meshlib
+if not defined VCPKG_DEFAULT_TRIPLET set VCPKG_DEFAULT_TRIPLET=x64-windows-meshlib
+echo Using vcpkg triplet: %VCPKG_DEFAULT_TRIPLET%
REM Check if AWS CLI is installed
set "aws_cli_available=false"
@@ -32,12 +38,12 @@ if not defined vcpkg_path (
echo Using vcpkg version: !VCPKG_TAG!
-REM Check for --write-s3 option
+REM Check for CLI options
set "write_s3_option=false"
+set "use_s3_assets=false"
for %%i in (%*) do (
- if /I "%%i"=="--write-s3" (
- set "write_s3_option=true"
- )
+ if /I "%%i"=="--write-s3" set "write_s3_option=true"
+ if /I "%%i"=="--use-s3-asset-provider" set "use_s3_assets=true"
)
if "!write_s3_option!"=="true" if "!aws_cli_available!"=="false" (
echo "Error: --write-s3 requires AWS CLI to be installed."
@@ -48,16 +54,24 @@ REM Configure VCPKG_BINARY_SOURCES (only use s3 cache when aws cli is available)
if "!aws_cli_available!"=="true" (
if "!write_s3_option!"=="true" (
echo "Mode: pull-push vcpkg binary cache. AWS credentials are required."
- set "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg-export/!VCPKG_TAG!/x64-windows-meshlib/,readwrite;"
+ set "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg-export/!VCPKG_TAG!/!VCPKG_DEFAULT_TRIPLET!/,readwrite;"
) else (
echo "Mode: pull vcpkg binary cache. No AWS credentials are required."
- set "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg-export/!VCPKG_TAG!/x64-windows-meshlib/,readwrite;"
+ set "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg-export/!VCPKG_TAG!/!VCPKG_DEFAULT_TRIPLET!/,readwrite;"
)
) else (
echo "Mode: build from source (no S3 binary cache)."
set "VCPKG_BINARY_SOURCES=clear"
)
+if "!use_s3_assets!"=="true" (
+ echo Mode: S3 asset provider ^(thirdparty\asset-provider-s3.bat^).
+ set "SCRIPT_PATH=%~dp0asset-provider-s3.bat"
+ set "X_VCPKG_ASSET_SOURCES=clear;x-script,!SCRIPT_PATH! {url} {sha512} {dst}"
+) else (
+ set "X_VCPKG_ASSET_SOURCES="
+)
+
REM Ensure vcpkg downloads folder exists
if not exist "!vcpkg_path!downloads\" mkdir "!vcpkg_path!downloads"
if exist "%~dp0vcpkg\downloads\" (
diff --git a/thirdparty/vcpkg/triplets/x64-windows-meshlib-iterator-debug.cmake b/thirdparty/vcpkg/triplets/x64-windows-meshlib-iterator-debug.cmake
new file mode 100644
index 000000000000..1f2cc7b7899f
--- /dev/null
+++ b/thirdparty/vcpkg/triplets/x64-windows-meshlib-iterator-debug.cmake
@@ -0,0 +1,10 @@
+set(VCPKG_TARGET_ARCHITECTURE x64)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE dynamic)
+set(VCPKG_DISABLE_COMPILER_TRACKING ON)
+
+set(VCPKG_PLATFORM_TOOLSET "v142")
+set(VCPKG_CMAKE_CONFIGURE_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS} -T v142")
+
+set(VCPKG_CXX_FLAGS_DEBUG "${VCPKG_CXX_FLAGS_DEBUG} /D_ITERATOR_DEBUG_LEVEL=2")
+set(VCPKG_C_FLAGS_DEBUG "${VCPKG_C_FLAGS_DEBUG} /D_ITERATOR_DEBUG_LEVEL=2")
\ No newline at end of file