From 281f8137f5bfedf965b6c04e82e1880b8f0156fb Mon Sep 17 00:00:00 2001 From: gxalpha Date: Fri, 1 Nov 2024 21:13:00 +0100 Subject: [PATCH] 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. --- frontend/OBSApp.cpp | 5 ----- frontend/dialogs/OBSAbout.cpp | 7 +------ frontend/widgets/OBSBasic.cpp | 2 -- libobs/CMakeLists.txt | 2 -- libobs/cmake/libobsConfig.cmake.in | 2 ++ libobs/cmake/linux/libobs.pc.in | 2 +- libobs/obs-config.h | 10 ---------- plugins/obs-outputs/flv-mux.c | 4 ---- 8 files changed, 4 insertions(+), 30 deletions(-) diff --git a/frontend/OBSApp.cpp b/frontend/OBSApp.cpp index 3da732715..ac378a17f 100644 --- a/frontend/OBSApp.cpp +++ b/frontend/OBSApp.cpp @@ -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 << " ("; diff --git a/frontend/dialogs/OBSAbout.cpp b/frontend/dialogs/OBSAbout.cpp index e9103dbab..f0a1b82d9 100644 --- a/frontend/dialogs/OBSAbout.cpp +++ b/frontend/dialogs/OBSAbout.cpp @@ -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); diff --git a/frontend/widgets/OBSBasic.cpp b/frontend/widgets/OBSBasic.cpp index 929f7e8de..072e2b235 100644 --- a/frontend/widgets/OBSBasic.cpp +++ b/frontend/widgets/OBSBasic.cpp @@ -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); diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 6593cb472..5d27883bb 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -281,8 +281,6 @@ target_include_directories( PUBLIC "$" "$" ) -target_compile_definitions(libobs PUBLIC HAVE_OBSCONFIG_H) - set( public_headers callback/calldata.h diff --git a/libobs/cmake/libobsConfig.cmake.in b/libobs/cmake/libobsConfig.cmake.in index 44e17220d..f49891241 100644 --- a/libobs/cmake/libobsConfig.cmake.in +++ b/libobs/cmake/libobsConfig.cmake.in @@ -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) diff --git a/libobs/cmake/linux/libobs.pc.in b/libobs/cmake/linux/libobs.pc.in index 580c071ea..596875720 100644 --- a/libobs/cmake/linux/libobs.pc.in +++ b/libobs/cmake/linux/libobs.pc.in @@ -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 diff --git a/libobs/obs-config.h b/libobs/obs-config.h index c1704cf3c..941597e30 100644 --- a/libobs/obs-config.h +++ b/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) -#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 diff --git a/plugins/obs-outputs/flv-mux.c b/plugins/obs-outputs/flv-mux.c index dc402930a..80b02e04f 100644 --- a/plugins/obs-outputs/flv-mux.c +++ b/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); -#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, ")");