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
[Suggestion]: Remove /W3
being used when installing packages on Windows
#26699
Comments
The problem actually is people having (non-default) warning levels in the build scripts instead of using what is externally supplied. It is a upstream failure to not provide a way to suppress/deactivate their dev build flags. |
Can you clarify who "people" refers to in this comment? If you mean |
The user's personal settings should be able to override this option. |
People writing build scripts for their libraries and hardcoding the warning options.
You can. Provide a toolchain with the warning level you want and vcpkg will try to force it down all builds within vcpkg. But this will always generate warnings because people hardcode their warnings level in their build scripts ....
means you are hardcoding the warning level in your build script.
If your project is within vcpkg as a port: No! Otherwise your project outside vcpkg using vcpkg: yes.
The toolchain is a personal setting within vcpkg, so it has to take control. |
CMake hasn't added
I disagree. I see the problem as vcpkg making assumptions about the project that are wrong.
No, that's inconsiderate to users. I shouldn't even need a toolchain file at all, let alone having to provide one just to explicitly specify what amounts to CMake's default behavior.
And if the project wants to do that, it should be allowed to. It might even be a requirement from company policies. It's reasonably likely to be specified in CMake presets in such cases, for example. |
@craigscott-crascit I think you are mixing outside/inside vcpkg. The issue has nothing to do with CMake or its defaults. This is purely inside vcpkg itself
vcpkg does not assume anything it just passes a
vcpkg internally always passes a (chainload) toolchain since that is the ground truth for the build of (nearly) all ports. If the users do not like the default behavior, they are free to supply their own via the triplet by setting
this is an issue external to vcpkg and I don't mind warning flags in CMake presets. Warning flags set within
vcpkg is not forcing |
Well my situation is I'm working on an internal vcpkg registry, building an internal project. I hit exactly this problem because vcpkg automatically and unexpectedly added
As I stated before, in this case users want the default behavior.... CMake's default behavior, not the overridden "default" behavior that vcpkg applies as its replacement. One of vcpkg's stated goals is that projects shouldn't have to add vcpkg-specific logic, but that's precisely what this behavior is causing.
That is not what I observe. |
yeah because
Setup a new triplet: x64-windows-cmake-default. Set You don't need vcpkg specific logic in your project but you still need to setup vcpkg the way you want it to be. So you just need a triplet with the dev settings you want. I for example use https://github.com/Neumann-A/my-vcpkg-triplets/blob/master/x64-win-llvm.cmake to have a clang-cl build of everything. So again: If you want your dev compiler flags in vcpkg you need to supply a triplet with a toolchain with those flags. Otherwise vcpkg will just use its default toolchain.
Yeah because you are not outside of vcpkg. -> It affects all projects that build through vcpkg. -> that is inside vcpkg not outside. Outside vcpkg: |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
Hi,
This might be the wrong place to post this, so here goes.
I have noticed that when
vcpkg
installs a package on Windows, it adds/W3
to the CXXFLAGS, see below.vcpkg/scripts/toolchains/windows.cmake
Line 54 in 927006b
This causes the following warning to be generated by MSVC 2019 when we in our projects use
/W4
:This warning will be generated for each translation unit. When looking through the logs for troubleshooting a failed installation, this warning produces noise.
Why does
vcpkg
set this warning at all? Should it not be up to the individual projects to decide their warning level preference?Proposal
vcpkg should not set warning flags for any toolchain and leave that responsibility up to each package maintainer.
EDIT: Added link to line in question.
The text was updated successfully, but these errors were encountered: