Skip to content

Conversation

@jkwak-work
Copy link
Contributor

@jkwak-work jkwak-work commented Oct 15, 2025

This is another attempt to get the PR #315 working.

Here is what is different from PR #315.
The MSVC Toolset version for VS2022 is v14.3.
However MS used up the minor version number from 14.31.XXX to 14.39.XXX and started using 14.40.XXX.

Although the first three digits of the version numbers are 144, 14.4X is still considered v14.3 toolset.
The current CMake setup needs to recognize this correctly.

You can find more official details and explanations from the following URL:
https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/

The C++ Project System (MS Build) is being updated to support '14.4x' MSVC toolsets under the v143 Platform Toolset.

@jkwak-work jkwak-work self-assigned this Oct 15, 2025
@jkwak-work jkwak-work requested a review from a team as a code owner October 15, 2025 23:31
@jkwak-work jkwak-work added the bug Something isn't working label Oct 15, 2025
@jkwak-work
Copy link
Contributor Author

Fixes #312

@jkwak-work jkwak-work marked this pull request as draft October 16, 2025 00:08
The previous code incorrectly derived platform toolset "v144" from
MSVC toolset version 14.44+, but v144 does not exist. All VS 2022
versions (including 14.3X and 14.4X) use the v143 platform toolset.

This fix properly maps toolset versions to their corresponding
platform toolsets:
- 14.0X -> v140 (VS 2015)
- 14.1X -> v141 (VS 2017)
- 14.2X -> v142 (VS 2019)
- 14.3X-14.4X -> v143 (VS 2022)

Reference: https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/
> The C++ Project System (MS Build) is being updated to support '14.4x' MSVC toolsets under the v143 Platform Toolset.
@jkwak-work jkwak-work marked this pull request as ready for review October 16, 2025 00:52
@skallweitNV
Copy link
Contributor

skallweitNV commented Oct 16, 2025

So this PR basically adds an option SGL_MSVC_TOOLSET_VERSION that when set will go and set VCPKG_PLATFORM_TOOLSET_VERSION and corresponding VCPKG_PLATFORM_TOOLSET. The main thing it does is figure out the corresponding VCPKG_PLATFORM_TOOLSET (which might break in the future). So my question is wouldn't it be easier to just set the VCPKG vars directly? Because if this is a fundamental vcpkg issue, I would assume they fix that upstream at some point.

Edit: I've tested this locally and it seems to work (other than rebuilding all the vcpkg deps because the hash changed due to the triplet file I guess). So I'm generally OK merging this, but I would put a big disclaimer explaining that this is a workaround for a vcpkg issue. Also, we now have a aarch64 triplet so that might need the same change if we want to be consistent.

@jkwak-work
Copy link
Contributor Author

Thanks for testing it out.

Let me do a little more research on that.

The part I am not clear now is how vcpkg works. It might be a matter of upgrading vcpkg on my local machine or slangpy is not setup to use the latest?

@jkwak-work jkwak-work marked this pull request as draft October 16, 2025 17:03
@jkwak-work
Copy link
Contributor Author

Changing to a draft because I don't think I got to the root of the cause.

If I remember correctly, vcpkg was using 14.44 version and cmake was using 14.38 version.
At that point, I thought that the problem was on vcpkg, because it looked like it was using v144, which turned out to be just v143.

I think the problem is on cmake not recognizing 14.44.XXX as v143.
It could be a bug in cmake itself or it could be a big in CMake scripts we wrote.

I need to investigate more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants