浏览代码

UI,libobs,obs-outputs: Remove HAVE_OBSCONFIG_H ifdefs

With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.

As removing the definition itself could be seen as a breaking change,
this simply moves the definition to pc.in and cmake.in files for now to
preserve the value for plugins that might expect this to be set. We may
remove the definition entirely in a later release.
gxalpha 11 月之前
父节点
当前提交
281f8137f5

+ 0 - 5
frontend/OBSApp.cpp

@@ -1119,12 +1119,7 @@ string OBSApp::GetVersionString(bool platform) const
 {
 {
 	stringstream ver;
 	stringstream ver;
 
 
-#ifdef HAVE_OBSCONFIG_H
 	ver << obs_get_version_string();
 	ver << obs_get_version_string();
-#else
-	ver << LIBOBS_API_MAJOR_VER << "." << LIBOBS_API_MINOR_VER << "." << LIBOBS_API_PATCH_VER;
-
-#endif
 
 
 	if (platform) {
 	if (platform) {
 		ver << " (";
 		ver << " (";

+ 1 - 6
frontend/dialogs/OBSAbout.cpp

@@ -20,18 +20,13 @@ OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout)
 	ui->setupUi(this);
 	ui->setupUi(this);
 
 
 	QString bitness;
 	QString bitness;
-	QString ver;
 
 
 	if (sizeof(void *) == 4)
 	if (sizeof(void *) == 4)
 		bitness = " (32 bit)";
 		bitness = " (32 bit)";
 	else if (sizeof(void *) == 8)
 	else if (sizeof(void *) == 8)
 		bitness = " (64 bit)";
 		bitness = " (64 bit)";
 
 
-#ifdef HAVE_OBSCONFIG_H
-	ver += obs_get_version_string();
-#else
-	ver += LIBOBS_API_MAJOR_VER + "." + LIBOBS_API_MINOR_VER + "." + LIBOBS_API_PATCH_VER;
-#endif
+	QString ver = obs_get_version_string();
 
 
 	ui->version->setText(ver + bitness);
 	ui->version->setText(ver + bitness);
 
 

+ 0 - 2
frontend/widgets/OBSBasic.cpp

@@ -491,9 +491,7 @@ OBSBasic::OBSBasic(QWidget *parent) : OBSMainWindow(parent), undo_s(ui), ui(new
 	QPoint newPos = curPos + statsDockPos;
 	QPoint newPos = curPos + statsDockPos;
 	statsDock->move(newPos);
 	statsDock->move(newPos);
 
 
-#ifdef HAVE_OBSCONFIG_H
 	ui->actionReleaseNotes->setVisible(true);
 	ui->actionReleaseNotes->setVisible(true);
-#endif
 
 
 	ui->previewDisabledWidget->setContextMenuPolicy(Qt::CustomContextMenu);
 	ui->previewDisabledWidget->setContextMenuPolicy(Qt::CustomContextMenu);
 	connect(ui->enablePreviewButton, &QPushButton::clicked, this, &OBSBasic::TogglePreview);
 	connect(ui->enablePreviewButton, &QPushButton::clicked, this, &OBSBasic::TogglePreview);

+ 0 - 2
libobs/CMakeLists.txt

@@ -281,8 +281,6 @@ target_include_directories(
   PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/config>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
   PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/config>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
 )
 )
 
 
-target_compile_definitions(libobs PUBLIC HAVE_OBSCONFIG_H)
-
 set(
 set(
   public_headers
   public_headers
   callback/calldata.h
   callback/calldata.h

+ 2 - 0
libobs/cmake/libobsConfig.cmake.in

@@ -9,3 +9,5 @@ find_dependency(Threads REQUIRED)
 
 
 include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
 include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
 check_required_components("@PROJECT_NAME@")
 check_required_components("@PROJECT_NAME@")
+
+set_property(TARGET OBS::libobs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_OBSCONFIG_H)

+ 1 - 1
libobs/cmake/linux/libobs.pc.in

@@ -10,4 +10,4 @@ Version: @OBS_VERSION_CANONICAL@
 Requires:
 Requires:
 Libs: -L${libdir} -lobs
 Libs: -L${libdir} -lobs
 Libs.private: -pthread -lm
 Libs.private: -pthread -lm
-Cflags: -I${includedir} -std=gnu@CMAKE_C_STANDARD@ -fPIC -fvisibility=hidden -fopenmp-simd -Werror
+Cflags: -I${includedir} -std=gnu@CMAKE_C_STANDARD@ -fPIC -fvisibility=hidden -fopenmp-simd -Werror -DHAVE_OBSCONFIG_H

+ 0 - 10
libobs/obs-config.h

@@ -47,16 +47,6 @@
 
 
 #define LIBOBS_API_VER MAKE_SEMANTIC_VERSION(LIBOBS_API_MAJOR_VER, LIBOBS_API_MINOR_VER, LIBOBS_API_PATCH_VER)
 #define LIBOBS_API_VER MAKE_SEMANTIC_VERSION(LIBOBS_API_MAJOR_VER, LIBOBS_API_MINOR_VER, LIBOBS_API_PATCH_VER)
 
 
-#ifdef HAVE_OBSCONFIG_H
 #include "obsconfig.h"
 #include "obsconfig.h"
-#else
-#define OBS_VERSION "unknown"
-#define OBS_DATA_PATH "../../data"
-#define OBS_INSTALL_PREFIX ""
-#define OBS_PLUGIN_DESTINATION "obs-plugins"
-#define OBS_RELATIVE_PREFIX "../../"
-#define OBS_RELEASE_CANDIDATE 0
-#define OBS_BETA 0
-#endif
 
 
 #define OBS_INSTALL_DATA_PATH OBS_INSTALL_PREFIX "/" OBS_DATA_PATH
 #define OBS_INSTALL_DATA_PATH OBS_INSTALL_PREFIX "/" OBS_DATA_PATH

+ 0 - 4
plugins/obs-outputs/flv-mux.c

@@ -230,11 +230,7 @@ static void build_flv_meta_data(obs_output_t *context, uint8_t **output, size_t
 
 
 	dstr_printf(&encoder_name, "%s (libobs version ", MODULE_NAME);
 	dstr_printf(&encoder_name, "%s (libobs version ", MODULE_NAME);
 
 
-#ifdef HAVE_OBSCONFIG_H
 	dstr_cat(&encoder_name, obs_get_version_string());
 	dstr_cat(&encoder_name, obs_get_version_string());
-#else
-	dstr_catf(&encoder_name, "%d.%d.%d", LIBOBS_API_MAJOR_VER, LIBOBS_API_MINOR_VER, LIBOBS_API_PATCH_VER);
-#endif
 
 
 	dstr_cat(&encoder_name, ")");
 	dstr_cat(&encoder_name, ")");