Skip to content
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

VCPKG Uses the wrong Visual Studio Toolset when using Ninja as the generator #43201

Closed
ccpjosephf opened this issue Jan 10, 2025 · 2 comments
Closed
Assignees
Labels
category:question This issue is a question

Comments

@ccpjosephf
Copy link

ccpjosephf commented Jan 10, 2025

Describe the bug
I am setting: set(VCPKG_PLATFORM_TOOLSET v141) inside a custom triplet that I am passing to vcpkg via:

"cacheVariables": {
    "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/vcpkg/triplets",
    "VCPKG_TARGET_TRIPLET": "my-custom-triplet",
    "VCPKG_HOST_TRIPLET": "my-custom-triplet"
},

Environment

  • OS: Windows
  • Compiler: Visual Studio v141, but also have v143 installed (or just any newer version)

To Reproduce
Steps to reproduce the behavior:

  1. specify a toolset in a custom triplet. Use Ninja Multi-Config as the generator
  2. call cmake build with --verbose, see that the latest toolset version is used, regardless of what value VCPKG_PLATFORM_TOOLSET was set to in the triplet file

Expected behavior
The project gets compiled by the version of compiler specified in by VCPKG_PLATFORM_TOOLSET in the triplet file

Failure logs
set(VCPKG_PLATFORM_TOOLSET v141)

Run Build Command(s): C:/. . . . ./CMake/Ninja/ninja.exe -v -f build-Debug.ninja MyProject
[1/19] C:\. . . . .\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\cl.exe

When running my configure step I get the log lines:

-- Running vcpkg install
Detecting compiler hash for triplet my-custom-triplet...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
@Neumann-A
Copy link
Contributor

vcpkg has no control about your top level dev environment or project.

@JonLiu1993 JonLiu1993 added the category:question This issue is a question label Jan 13, 2025
@ccpjosephf
Copy link
Author

Thanks for the response, I've probably misunderstood something about Ninja. I'll close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants