Disable Linux WebView in Dynamic Version

This commit is contained in:
Hassan DRAGA 2024-07-11 22:09:34 -04:00
parent 0826a2c5f8
commit 9c07d87041
3 changed files with 19 additions and 5 deletions

View File

@ -118,7 +118,7 @@ endif
@cd "$(BUILD_DIR)/debug" \ @cd "$(BUILD_DIR)/debug" \
&& echo "Build WebUI library ($(CC) $(TARGET)debug dynamic)..." \ && echo "Build WebUI library ($(CC) $(TARGET)debug dynamic)..." \
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -g -fPIC \ && $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -g -fPIC \
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) -g -fPIC -DWEBUI_LOG \ && $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) -g -fPIC -DWEBUI_LOG -DWEBUI_DYNAMIC \
&& $(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) && $(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)
ifeq ($(PLATFORM),windows) ifeq ($(PLATFORM),windows)
@cd "$(BUILD_DIR)/debug" && del *.o >nul 2>&1 @cd "$(BUILD_DIR)/debug" && del *.o >nul 2>&1
@ -151,7 +151,7 @@ endif
@cd "$(BUILD_DIR)" \ @cd "$(BUILD_DIR)" \
&& echo "Build WebUI library ($(CC) $(TARGET)release dynamic)..." \ && echo "Build WebUI library ($(CC) $(TARGET)release dynamic)..." \
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -Os -fPIC \ && $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -Os -fPIC \
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) -O3 -fPIC \ && $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) -O3 -fPIC -DWEBUI_DYNAMIC \
&& $(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) && $(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)
# Clean # Clean
ifeq ($(PLATFORM),windows) ifeq ($(PLATFORM),windows)

View File

@ -53,7 +53,7 @@ debug:
# Dynamic with Debug info # Dynamic with Debug info
@echo Build WebUI Library (MSVC Debug Dynamic)... @echo Build WebUI Library (MSVC Debug Dynamic)...
@cl /Zi $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) @cl /Zi $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS)
@cl /Zi $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) /D WEBUI_LOG @cl /Zi $(WEBUI_BUILD_FLAGS) $(WARNING_LOG) /D WEBUI_LOG /D WEBUI_DYNAMIC
@link $(LIB_DYN_OUT) @link $(LIB_DYN_OUT)
# Clean # Clean
@- del *.obj >nul 2>&1 @- del *.obj >nul 2>&1
@ -72,7 +72,7 @@ release:
# Dynamic Release # Dynamic Release
@echo Build WebUI Library (MSVC Release Dynamic)... @echo Build WebUI Library (MSVC Release Dynamic)...
@cl $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) @cl $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS)
@cl $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) @cl $(WEBUI_BUILD_FLAGS) $(WARNING_RELEASE) /D WEBUI_DYNAMIC
@link $(LIB_DYN_OUT) @link $(LIB_DYN_OUT)
# Clean # Clean
@- del *.pdb >nul 2>&1 @- del *.pdb >nul 2>&1

View File

@ -116,6 +116,12 @@
#define WEBUI_WS_PROTOCOL "ws://" #define WEBUI_WS_PROTOCOL "ws://"
#endif #endif
#ifdef WEBUI_DYNAMIC
#define WEBUI_LIB_TYPE "Dynamic"
#else
#define WEBUI_LIB_TYPE "Static"
#endif
#ifdef _WIN32 #ifdef _WIN32
#define WEBUI_OS "Microsoft Windows" #define WEBUI_OS "Microsoft Windows"
#elif __APPLE__ #elif __APPLE__
@ -3741,7 +3747,7 @@ static void * _webui_malloc(size_t size) {
static _webui_window_t* _webui_dereference_win_ptr(void * ptr) { static _webui_window_t* _webui_dereference_win_ptr(void * ptr) {
#ifdef WEBUI_LOG_VERBOSE #ifdef WEBUI_LOG_VERBOSE
printf("[Core]\t\t_webui_dereference_win_ptr()\n"); //printf("[Core]\t\t_webui_dereference_win_ptr()\n");
#endif #endif
if (_webui_mutex_is_exit_now(WEBUI_MUTEX_NONE)) if (_webui_mutex_is_exit_now(WEBUI_MUTEX_NONE))
@ -7395,6 +7401,7 @@ static void _webui_init(void) {
WEBUI_VERSION " (" WEBUI_VERSION " ("
WEBUI_OS ", " WEBUI_OS ", "
WEBUI_COMPILER ", " WEBUI_COMPILER ", "
WEBUI_LIB_TYPE ", "
WEBUI_SECURE ")\n"); WEBUI_SECURE ")\n");
printf("[Core]\t\t_webui_init()\n"); printf("[Core]\t\t_webui_init()\n");
#endif #endif
@ -10762,6 +10769,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
// Linux GTK WebView // Linux GTK WebView
#ifdef WEBUI_DYNAMIC
#ifdef WEBUI_LOG
printf("[Core]\t\t_webui_wv_show() -> WebUI dynamic version does not support Linux WebView\n");
#endif
return false;
#endif
if (_webui.is_browser_main_run) if (_webui.is_browser_main_run)
return false; return false;