From 04b626c12cf9fcecabdf6662bd602a81aa498290 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi
Date: Fri, 16 Oct 2020 21:17:46 +0300
Subject: [PATCH 1/1] Loading resources from a predetermined path
CMakeLists.txt | 2 ++
src/app.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c65bab6..0fb306f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,6 +277,8 @@ MimeType=x-scheme-handler/gemini;
RENAME fi.skyjake.lagrange.png
)
if (NOT ENABLE_RESOURCE_EMBED)
target_compile_definitions (app PUBLIC
LAGRANGE_EMB_BIN="${CMAKE_INSTALL_PREFIX}/share/lagrange/resources.binary")
install (FILES ${EMB_BIN} DESTINATION share/lagrange)
endif ()
endif ()
diff --git a/src/app.c b/src/app.c
index ddd0084f..ac970865 100644
--- a/src/app.c
+++ b/src/app.c
@@ -76,6 +76,10 @@ static const char *dataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange";
#define EMB_BIN "../../share/lagrange/resources.binary"
static const char *dataDir_App_ = "~/.config/lagrange";
#endif
+#if defined (LAGRANGE_EMB_BIN) /* specified in build config */
+# undef EMB_BIN
+# define EMB_BIN LAGRANGE_EMB_BIN
+#endif
#define EMB_BIN2 "../resources.binary" /* fallback from build/executable dir */
static const char *prefsFileName_App_ = "prefs.cfg";
static const char *stateFileName_App_ = "state.binary";
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).