You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Ninja in Windows CI and explicitly set the VS toolset version. (#4759)
[SC-41556]
Since the GHA `windows-2022` runners [updated their version of Visual
Studio
yesterday](https://github.com/actions/runner-images/releases/tag/win22%2F20240218.2),
we have been seeing errors of the form `error LNK2019: unresolved
external symbol _Thrd_sleep_for`. After some investigation, the cause of
the errors was found to be that the vcpkg dependencies were built with
the new MSVC toolset (14.39), while the main CMake project was built
with the old one (14.38)[^1].
After efforts to make the main project build with the 14.39 toolset (by
passing `-T v143,version=14.39` or
`-DCMAKE_VS_PLATFORM_TOOLSET_VERSION=14.39`) were unsuccessful, this PR
switches to using the Ninja generator instead of Visual Studio. With
Ninja the toolset version is specified by [a GitHub
action](https://github.com/marketplace/actions/setup-msvc-developer-command-prompt)
that sets the necessary environment variables.
[^1]: If the opposite were to happen, it would be supported. Objects
built with varying versions of MSVC toolsets [are
binary-compatible](https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-170)
with each other, but the final linking must be done with the newest
version.
---
TYPE: BUILD
DESC: Fix linker errors when building with MSVC
0 commit comments