-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake-based projects fail to build using Visual Studio 2019 with toolset v141 #7318
Comments
@ceranco, thanks for posting this! From https://github.com/microsoft/vcpkg/blob/4498b6403e0ef1e441a3c4df36e45fda9b181237/docs/users/triplets.md#vcpkg_platform_toolset, I think you might need to install v142 toolset. |
Hi @PhoebeHui, Visual Studio 2019 comes installed with v142 by default, but you can optionally install and build with v141 for compatibility with Visual Studio 2017. From the docs:
From step 2: v141 is determined by the triplet. |
@ceranco, see https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_cmake.cmake#L116, it use toolsets to match cmake generator here, so it try to get visual studio 2017. not sure if pair ( Visual Studio 2019, v141) will support in future. Doc says that VCPKG_PLATFORM_TOOLSET valid settings is: |
vcpkg uses |
@ceranco Please add |
@meastp I've added Since opening this issue I've stopped using C++ and @Rastaban If this problem is still being worked on, it might be better to close the current one and have someone that is actively using |
@ceranco Thanks - note that crashrpt does not build with |
This issue still occurs in latest vcpkg(2021-08-03-1a6d67b8150e94b7f473c6ab1c0cfd) with osg port. |
My idea is to add a VCPKG_GENERATOR_TOOLSET to correctly generate the -G parameter of cmake.
Add VCPKG_GENERATOR_TOOLSET output in vcpkg-tool
build.cpp
visualstudio.cpp
|
I can confirm this issue was fixed using the following command:
|
@JackBoosY I created a new x64-windows-v141.cmake file
It is correct to implement it directly.
However, when I delete the PREFER_NINJA in the portfile.cmake file of basisu port, it reports an error
|
set(VCPKG_PLATFORM_TOOLSET v142) |
But I just want to compile with toolset v141 when only vs2019 is installed |
Can you please replace {
...
"dependencies": [
...
{
"name": "vcpkg-cmake",
"host": true
}
]
} |
Originally this issue was the following: #6475, but because this affects many packages I thought it was better to open a new issue.
Environment
Windows 10
Visual Studio 2019 with v141 toolset installed.
Vcpkg version: 2019.06.26-nohash
The Problem
When trying to build
osg
with the following triplet:many of its dependencies (and itself) all fail with the same error:
Basically CMake tries to use Visual Studio 2017 as its generator instead of Visual Studio 2019.
CMake-based projects that fail
CMake-based projects that succeed
Possible Reason
The difference between projects that do and don't is in the
configure_cmake(...)
call in their portfiles:Projects that succeed use the
PREFER_NINJA
option:Workaround
Manually adding the
PREFER_NINJA
option to the portfiles of the failing projects seems to fix the problem (or at least allows them too build).The text was updated successfully, but these errors were encountered: