Browse Source

libobs: Assume Qt 6, always warn about Qt 5 plugins

gxalpha 2 years ago
parent
commit
5ed0b8a0b8
3 changed files with 4 additions and 17 deletions
  1. 1 8
      libobs/cmake/legacy.cmake
  2. 3 3
      libobs/util/platform-nix.c
  3. 0 6
      libobs/util/platform-windows.c

+ 1 - 8
libobs/cmake/legacy.cmake

@@ -20,12 +20,6 @@ find_package(
   OPTIONAL_COMPONENTS avcodec)
 find_package(ZLIB REQUIRED)
 
-if(ENABLE_UI)
-  find_qt(COMPONENTS Core)
-else()
-  set(_QT_VERSION 0)
-endif()
-
 add_library(libobs SHARED)
 add_library(OBS::libobs ALIAS libobs)
 
@@ -474,8 +468,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obsconfig.h.in ${CMAKE_BINARY_DIR}/co
 target_compile_definitions(
   libobs
   PUBLIC HAVE_OBSCONFIG_H
-  PRIVATE "OBS_INSTALL_PREFIX=\"${OBS_INSTALL_PREFIX}\"" "OBS_QT_VERSION=${_QT_VERSION}"
-          "$<$<BOOL:${LINUX_PORTABLE}>:LINUX_PORTABLE>")
+  PRIVATE "OBS_INSTALL_PREFIX=\"${OBS_INSTALL_PREFIX}\"" "$<$<BOOL:${LINUX_PORTABLE}>:LINUX_PORTABLE>")
 
 if(ENABLE_FFMPEG_MUX_DEBUG)
   target_compile_definitions(libobs PRIVATE SHOW_SUBPROCESSES)

+ 3 - 3
libobs/util/platform-nix.c

@@ -16,7 +16,7 @@
 
 #include "obsconfig.h"
 
-#if !defined(__APPLE__) && OBS_QT_VERSION == 6
+#if !defined(__APPLE__)
 #define _GNU_SOURCE
 #include <link.h>
 #include <stdlib.h>
@@ -106,7 +106,7 @@ void os_dlclose(void *module)
 		dlclose(module);
 }
 
-#if !defined(__APPLE__) && OBS_QT_VERSION == 6
+#if !defined(__APPLE__)
 int module_has_qt5_check(const char *path)
 {
 	void *mod = os_dlopen(path);
@@ -147,7 +147,7 @@ void get_plugin_info(const char *path, bool *is_obs_plugin, bool *can_load)
 {
 	*is_obs_plugin = true;
 	*can_load = true;
-#if !defined(__APPLE__) && OBS_QT_VERSION == 6
+#if !defined(__APPLE__)
 	*can_load = !has_qt5_dependency(path);
 #endif
 	UNUSED_PARAMETER(path);

+ 0 - 6
libobs/util/platform-windows.c

@@ -138,7 +138,6 @@ void os_dlclose(void *module)
 	FreeLibrary(module);
 }
 
-#if OBS_QT_VERSION == 6
 static bool has_qt5_import(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 {
 	__try {
@@ -201,7 +200,6 @@ static bool has_qt5_import(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 
 	return false;
 }
-#endif
 
 static bool has_obs_export(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 {
@@ -335,13 +333,9 @@ void get_plugin_info(const char *path, bool *is_obs_plugin, bool *can_load)
 
 		*is_obs_plugin = has_obs_export(base, nt_headers);
 
-#if OBS_QT_VERSION == 6
 		if (*is_obs_plugin) {
 			*can_load = !has_qt5_import(base, nt_headers);
 		}
-#else
-		*can_load = true;
-#endif
 
 	} __except (EXCEPTION_EXECUTE_HANDLER) {
 		/* we failed somehow, for compatibility let's assume it