Skip to content

Add MSVC STL vector-algorithm switch and VS2019/v142 support - #272

Merged
danoli3 merged 1 commit into
masterfrom
ci/msvc-stl-switch-vs2019-v142
Nov 9, 2026
Merged

danoli3 merged 1 commit into
masterfrom
ci/msvc-stl-switch-vs2019-v142

Conversation

@danoli3

@danoli3 danoli3 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Adds the CMake pieces for building and consuming FreeImage with Visual Studio 2019 (v142) tools and for the MSVC STL vectorized-algorithm ABI setting (#266).

  • FREEIMAGE_MSVC_VECTOR_ALGORITHMS (default ON). OFF defines _USE_STD_VECTOR_ALGORITHMS=0 for the library and, publicly, for C++ consumers; MSVC requires the same value in every linked translation unit.
  • New vs2019 and vs2022-v142 presets.
  • The installed package records the MSVC version that produced a static archive and rejects an older consumer toolchain with repair instructions.
  • New windows-v142 CI job: builds with v142, then links the installed package from v142 and v143 consumers. packaging/tests/test-msvc-compatibility.cmake checks the diagnostics at configure time.
  • README sections on the option, v142 builds and the LNK2019 symptom.

Tested on macOS only: configure and build with the option OFF (no effect off MSVC), 19/19 CTest tests pass, and the nine toolset-mismatch cases in test-msvc-compatibility.cmake pass. The v142 presets and the windows-v142 job can only run on a Windows runner, so CI is the first real check of those.

- Add FREEIMAGE_MSVC_VECTOR_ALGORITHMS (default ON). When OFF, define _USE_STD_VECTOR_ALGORITHMS=0 for the library and, publicly, for C++ consumers, since MSVC requires the same value across linked translation units.
- Add vs2019 (v142) and vs2022-v142 configure presets.
- Make the installed CMake package record the producing MSVC version and refuse a static package when the consumer's MSVC is older, with repair instructions. The smoke project now enables CXX.
- Add a windows-v142 CI job that builds with the v142 toolset and links the installed package with v142 and v143 consumers, plus a configure-time test for the mismatch diagnostics.
- Document the option, v142 builds and the resulting LNK2019 symptom in the README.
@danoli3
danoli3 merged commit 0d32bb8 into master Nov 9, 2026
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant