Skip to content

Commit 9c07d87

Browse files
committed
Disable Linux WebView in Dynamic Version
1 parent 0826a2c commit 9c07d87

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

GNUmakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ endif
118118
@cd "$(BUILD_DIR)/debug" \
119119
&& echo "Build WebUI library ($(CC) $(TARGET)debug dynamic)..." \
120120
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -g -fPIC \
121-
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) -g -fPIC -DWEBUI_LOG \
121+
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) -g -fPIC -DWEBUI_LOG -DWEBUI_DYNAMIC \
122122
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o $(WEBKIT_OBJ) -g -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS)
123123
ifeq ($(PLATFORM),windows)
124124
@cd "$(BUILD_DIR)/debug" && del *.o >nul 2>&1
@@ -151,7 +151,7 @@ endif
151151
@cd "$(BUILD_DIR)" \
152152
&& echo "Build WebUI library ($(CC) $(TARGET)release dynamic)..." \
153153
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -Os -fPIC \
154-
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) -O3 -fPIC \
154+
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) -O3 -fPIC -DWEBUI_DYNAMIC \
155155
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o $(WEBKIT_OBJ) -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS)
156156
# Clean
157157
ifeq ($(PLATFORM),windows)

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ debug:
5353
# Dynamic with Debug info
5454
@echo Build WebUI Library (MSVC Debug Dynamic)...
5555
@cl /Zi $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS)
56-
@cl /Zi $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) /D WEBUI_LOG
56+
@cl /Zi $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) /D WEBUI_LOG /D WEBUI_DYNAMIC
5757
@link $(LIB_DYN_OUT)
5858
# Clean
5959
@- del *.obj >nul 2>&1
@@ -72,7 +72,7 @@ release:
7272
# Dynamic Release
7373
@echo Build WebUI Library (MSVC Release Dynamic)...
7474
@cl $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS)
75-
@cl $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE)
75+
@cl $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) /D WEBUI_DYNAMIC
7676
@link $(LIB_DYN_OUT)
7777
# Clean
7878
@- del *.pdb >nul 2>&1

src/webui.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@
116116
#define WEBUI_WS_PROTOCOL "ws://"
117117
#endif
118118

119+
#ifdef WEBUI_DYNAMIC
120+
#define WEBUI_LIB_TYPE "Dynamic"
121+
#else
122+
#define WEBUI_LIB_TYPE "Static"
123+
#endif
124+
119125
#ifdef _WIN32
120126
#define WEBUI_OS "Microsoft Windows"
121127
#elif __APPLE__
@@ -3741,7 +3747,7 @@ static void * _webui_malloc(size_t size) {
37413747
static _webui_window_t* _webui_dereference_win_ptr(void * ptr) {
37423748

37433749
#ifdef WEBUI_LOG_VERBOSE
3744-
printf("[Core]\t\t_webui_dereference_win_ptr()\n");
3750+
//printf("[Core]\t\t_webui_dereference_win_ptr()\n");
37453751
#endif
37463752

37473753
if (_webui_mutex_is_exit_now(WEBUI_MUTEX_NONE))
@@ -7395,6 +7401,7 @@ static void _webui_init(void) {
73957401
WEBUI_VERSION " ("
73967402
WEBUI_OS ", "
73977403
WEBUI_COMPILER ", "
7404+
WEBUI_LIB_TYPE ", "
73987405
WEBUI_SECURE ")\n");
73997406
printf("[Core]\t\t_webui_init()\n");
74007407
#endif
@@ -10762,6 +10769,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
1076210769

1076310770
// Linux GTK WebView
1076410771

10772+
#ifdef WEBUI_DYNAMIC
10773+
#ifdef WEBUI_LOG
10774+
printf("[Core]\t\t_webui_wv_show() -> WebUI dynamic version does not support Linux WebView\n");
10775+
#endif
10776+
return false;
10777+
#endif
10778+
1076510779
if (_webui.is_browser_main_run)
1076610780
return false;
1076710781

0 commit comments

Comments
 (0)