You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using vcpkg to manage dependencies for my project. Due to project requirements, I enabled /W4 and /WX to treat all warnings as errors. However, this causes warnings from third-party headers installed by vcpkg to also be treated as errors, which breaks the build.
I attempted to exclude these include directories by marking them as system headers using target_include_directories(... SYSTEM ...), but this does not work. It seems that vcpkg’s include paths are added before my own CMake commands, so my SYSTEM specification is not applied to them.
Is there a recommended way to mark all vcpkg-installed include directories as SYSTEM (or otherwise suppress warnings from vcpkg headers) so that they are not affected by /WX?
Any guidance or an official solution would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using vcpkg to manage dependencies for my project. Due to project requirements, I enabled /W4 and /WX to treat all warnings as errors. However, this causes warnings from third-party headers installed by vcpkg to also be treated as errors, which breaks the build.
I attempted to exclude these include directories by marking them as system headers using target_include_directories(... SYSTEM ...), but this does not work. It seems that vcpkg’s include paths are added before my own CMake commands, so my SYSTEM specification is not applied to them.
Is there a recommended way to mark all vcpkg-installed include directories as SYSTEM (or otherwise suppress warnings from vcpkg headers) so that they are not affected by /WX?
Any guidance or an official solution would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions