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

MSVC warning when compiling using find_package & vcpkg #125

Closed
matjam opened this issue Dec 20, 2021 · 1 comment
Closed

MSVC warning when compiling using find_package & vcpkg #125

matjam opened this issue Dec 20, 2021 · 1 comment

Comments

@matjam
Copy link

matjam commented Dec 20, 2021

Sorry, I don't have a ton of context on how the cmake integration works with vcpkg etc, but it seems like the settings for MSVC isn't correct somewhere.

C:\.....\vcpkg_installed\x64-windows\include\libzippp\libzippp.h(550): warning C4245: 'initializing': conversion from 'int' to 'libzippp_uint16', signed/unsigned mismatch

vcpkg installs libzippp-v5.0-1.8.0 which differs to what is in the master branch; so this might already be fixed. Looks like when the initialization constants are being passed to ZipEntry they are just int but are being implicitly cast to unsigned int etc.

As I only use libzippp.h in once place, I was able to hide these warnings by doing the following

#ifdef _MSC_VER
#pragma warning(disable: 4245) // disable warning 4345
#endif

#include <libzippp.h>

#ifdef _MSC_VER
#pragma warning(default: 4245) // enable warning 4345 back
#endif

When you google this general problem (like "suppress included library compiler warnings" or something like that) you get some suggestions to use target_include_directories(<target> SYSTEM <dir>) however I think all the magic inside vcpkg find_package means that the include directories part happens automatically and I don't get a chance to set them as SYSTEM. So maybe the long term fix is to have the vcpkg portfile mark the include dir as SYSTEM? Somehow?

Sorry I can't be more specific as I don't understand how the build system all hangs together - I just use it - and for the most part it all works just fine.

Hope report this helps; if not please feel free to close with extreme prejudice ;-)

@ctabin
Copy link
Owner

ctabin commented Dec 20, 2021

Hi @matjam,
This should already be fixed by #115, but not yet released.

@ctabin ctabin closed this as completed Dec 20, 2021
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

No branches or pull requests

2 participants