webview-python icon indicating copy to clipboard operation
webview-python copied to clipboard

Win32 build adjustments

Open rotoglup opened this issue 4 years ago • 2 comments

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 (2e5462f9224e092e51b173e4a39469bfc6118f73 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) {

rotoglup avatar Feb 09 '21 09:02 rotoglup

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. 👍

epoz avatar Feb 09 '21 16:02 epoz

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?

ministerinmarin avatar Jan 15 '23 07:01 ministerinmarin