-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix multiple issues with MSVC Windows build #178
Conversation
Thank you @elasota and Happy New Year! |
@@ -25,6 +25,7 @@ if(BUILD_STATIC) | |||
add_library(libunshield STATIC ${LIBUNSHIELD_HEADERS} ${LIBUNSHIELD_SOURCES}) | |||
else() | |||
add_library(libunshield SHARED ${LIBUNSHIELD_HEADERS} ${LIBUNSHIELD_SOURCES}) | |||
add_compile_definitions(LIBUNSHIELD_DYNAMIC_LIBRARY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't a private target definition it might leak and cause clients to define it and use dllexport
@@ -16,6 +16,12 @@ | |||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif | |||
|
|||
#if defined(_MSC_VER) && defined(LIBUNSHIELD_DYNAMIC_LIBRARY) | |||
#define UNSHIELD_DLLEXPORT __declspec(dllexport) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You get better optimization if you define it as dllimport for clients
Thanks @bwrsandman , looks like we might need a new PR to improve this one :) |
This fixes several problems with MSVC build and Windows:
stat
on the drive, which doesn't work, then attempting to call_mkdir
for the drive, which also doesn't work