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

Win32 build adjustments #6

Open
rotoglup opened this issue Feb 9, 2021 · 2 comments
Open

Win32 build adjustments #6

rotoglup opened this issue Feb 9, 2021 · 2 comments

Comments

@rotoglup
Copy link

rotoglup commented Feb 9, 2021

First, thanks for the nice work :) I'm writing thise issue for potential future reference/memory as this repo is mentionned as "Python bindings" in the webview repo

I've been giving webview-python a try on Win32, and I had to make some adjustments to get the build running - see below.

Also, the current master (2e5462f from July 2018) embeds IE11, which is well deprecated/abandonned now (2021).

diff --git a/setup.py b/setup.py
index 4084d94..6d05c30 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +34,7 @@ elif OSNAME == 'Darwin':
 elif OSNAME == 'Windows':
     define_macros = [('WEBVIEW_WINAPI', '1')]
     extra_cflags = ""
-    extra_ldflags = ['-framework', 'CoreAudio']
+    extra_ldflags = ['Advapi32.lib', 'Gdi32.lib']

 webview = Extension(
     'webview',
diff --git a/webview/webview.c b/webview/webview.c
index 8ae7244..755beea 100644
--- a/webview/webview.c
+++ b/webview/webview.c
@@ -5,6 +5,10 @@
 #define WEBVIEW_IMPLEMENTATION
 #include "webview.h"

+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 typedef struct { PyObject_HEAD struct webview w; } WebView;

 static void WebView_dealloc(WebView *self) {
@epoz
Copy link

epoz commented Feb 9, 2021

Thanks so much for sharing these small fixes @rotoglup ! I was trying to build webview-python on a new test Windows 10 machine and getting some gnarly errors, your fixes sorted out the issue. 👍

@ministerinmarin
Copy link

Thanks so much for sharing these small fixes @rotoglup ! I was trying to build webview-python on a new test Windows 10 machine and getting some gnarly errors, your fixes sorted out the issue. 👍

Did you successfully have it compiled?

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

3 participants