Skip to content

Extend MSVC version detection range. Due to MSVC Toolset Minor Version Number 14.40 in VS 2022 v17.10.#46

Merged
wada-at-live2d-com merged 2 commits intoLive2D:developfrom
cocotone:fix/msvc-version-increment
Jun 26, 2024
Merged

Extend MSVC version detection range. Due to MSVC Toolset Minor Version Number 14.40 in VS 2022 v17.10.#46
wada-at-live2d-com merged 2 commits intoLive2D:developfrom
cocotone:fix/msvc-version-increment

Conversation

@tatsuya-shiozawa
Copy link
Copy Markdown
Contributor

@tatsuya-shiozawa tatsuya-shiozawa commented Jun 22, 2024

I created a PR because I discovered a build error in CMake process caused by version detection of the build system and compiler.

Please refer to the reason of this case: https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/

When I tried to run a build with the latest version of Visual Studio that I own, I encountered a situation where the compiler version determination process in CMake returned an unexpected value and could not be handled.

Building x64 with Visual C++ Compiler 2022...
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.10.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- The C compiler identification is MSVC 19.40.33811.0 <----------- GREATER OF 1940
-- The CXX compiler identification is MSVC 19.40.33811.0 <----------- GREATER OF 1940
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

...failed

This change modifies the hard-coded version number ranges and may not be permanent depending on MSVC updates, but should resolve some immediate inconvenience for users.

@tatsuya-shiozawa
Copy link
Copy Markdown
Contributor Author

Appendix:
https://learn.microsoft.com/ja-jp/cpp/overview/compiler-versions?view=msvc-170

Visual Studio 2022 バージョン 17.10 1940

@wada-at-live2d-com
Copy link
Copy Markdown
Contributor

@tatsuya-shiozawa

Thank you for your contribution.
We are aware of the build issue with VS2022 that you pointed out, and we have determined that we should immediately incorporate this fix.
Since there were no problems with the operation, we will proceed with the merge after updating the CHANGELOG.

@wada-at-live2d-com
Copy link
Copy Markdown
Contributor

@tatsuya-shiozawa

We would like to update the CHANGELOG.md to inform users about the latest changes. Could you please either grant push permissions to wada-at-live2d-com on the forked repository, or update the changelog as follows?
Fork_6oCgFihTb8

## [Unreleased]

### Fixed

* Implement support for `MSVC19.40` in the VS2022 build. by [@tatsuya-shiozawa](https://github.com/Live2D/CubismNativeSamples/pull/46)

This commit was delegated work by wada-at-live2d-com.
@tatsuya-shiozawa
Copy link
Copy Markdown
Contributor Author

@wada-at-live2d-com

I pushed appendix commit for updating CHANGELOG as you noted.
please check.

@wada-at-live2d-com
Copy link
Copy Markdown
Contributor

@tatsuya-shiozawa

Thank you for your prompt response!
I have confirmed the addition, so I will proceed with the merge.

@wada-at-live2d-com wada-at-live2d-com merged commit 19c25ea into Live2D:develop Jun 26, 2024
@tatsuya-shiozawa tatsuya-shiozawa deleted the fix/msvc-version-increment branch June 26, 2024 04:23
@tatsuya-shiozawa
Copy link
Copy Markdown
Contributor Author

Thanks!

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.

2 participants