From dca2e9fe59f8c883d249dfc4673b8b4ec6d5c7a1 Mon Sep 17 00:00:00 2001 From: Syping Date: Mon, 20 Feb 2023 15:22:30 +0100 Subject: [PATCH] libragephoto: add option to enable ABI wrapper --- CMakeLists.txt | 8 ++++++++ src/SnapmaticPicture.h | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a789697..c168872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,6 +219,14 @@ if(FLATPAK_BUILD) ) endif() +option(RAGEPHOTO_ABI_WRAPPER "Use libragephoto's ABI wrapper" OFF) +if(RAGEPHOTO_ABI_WRAPPER) + set(RAGEPHOTO_C_API ON CACHE BOOL "Build libragephoto with C API support" FORCE) + list(APPEND GTA5VIEW_DEFINES + -DRAGEPHOTO_USE_ABI_WRAPPER + ) +endif() + option(WITH_DONATE "Donate menu option and donation dialog" OFF) if(WITH_DONATE) set(DONATE_ADDRESSES "" CACHE STRING "Donation addresses") diff --git a/src/SnapmaticPicture.h b/src/SnapmaticPicture.h index 66ef16c..e8cbc53 100644 --- a/src/SnapmaticPicture.h +++ b/src/SnapmaticPicture.h @@ -19,7 +19,12 @@ #ifndef SNAPMATICPICTURE_H #define SNAPMATICPICTURE_H -#include "RagePhoto.h" +#ifdef RAGEPHOTO_USE_ABI_WRAPPER +#include +typedef RagePhotoA RagePhoto; +#else +#include +#endif #include #include #include