mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-01 15:49:51 +08:00
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.
This commit is contained in:
@@ -1119,12 +1119,7 @@ string OBSApp::GetVersionString(bool platform) const
|
||||
{
|
||||
stringstream ver;
|
||||
|
||||
#ifdef HAVE_OBSCONFIG_H
|
||||
ver << obs_get_version_string();
|
||||
#else
|
||||
ver << LIBOBS_API_MAJOR_VER << "." << LIBOBS_API_MINOR_VER << "." << LIBOBS_API_PATCH_VER;
|
||||
|
||||
#endif
|
||||
|
||||
if (platform) {
|
||||
ver << " (";
|
||||
|
||||
@@ -20,18 +20,13 @@ OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout)
|
||||
ui->setupUi(this);
|
||||
|
||||
QString bitness;
|
||||
QString ver;
|
||||
|
||||
if (sizeof(void *) == 4)
|
||||
bitness = " (32 bit)";
|
||||
else if (sizeof(void *) == 8)
|
||||
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);
|
||||
|
||||
|
||||
@@ -491,9 +491,7 @@ OBSBasic::OBSBasic(QWidget *parent) : OBSMainWindow(parent), undo_s(ui), ui(new
|
||||
QPoint newPos = curPos + statsDockPos;
|
||||
statsDock->move(newPos);
|
||||
|
||||
#ifdef HAVE_OBSCONFIG_H
|
||||
ui->actionReleaseNotes->setVisible(true);
|
||||
#endif
|
||||
|
||||
ui->previewDisabledWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->enablePreviewButton, &QPushButton::clicked, this, &OBSBasic::TogglePreview);
|
||||
|
||||
@@ -281,8 +281,6 @@ target_include_directories(
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/config>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
)
|
||||
|
||||
target_compile_definitions(libobs PUBLIC HAVE_OBSCONFIG_H)
|
||||
|
||||
set(
|
||||
public_headers
|
||||
callback/calldata.h
|
||||
|
||||
@@ -9,3 +9,5 @@ find_dependency(Threads REQUIRED)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
set_property(TARGET OBS::libobs APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS HAVE_OBSCONFIG_H)
|
||||
|
||||
@@ -10,4 +10,4 @@ Version: @OBS_VERSION_CANONICAL@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lobs
|
||||
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
|
||||
|
||||
@@ -47,16 +47,6 @@
|
||||
|
||||
#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"
|
||||
#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
|
||||
|
||||
@@ -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);
|
||||
|
||||
#ifdef HAVE_OBSCONFIG_H
|
||||
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, ")");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user