summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-10-21 19:22:50 -0400
committerAndrew Opalach <andrew@akon.city> 2024-10-21 19:22:50 -0400
commit60b4ebfbf3be78dba9dc7c65ab2bdaa0b218c0c2 (patch)
tree08ff2ce7975f523112e7ad2fe4f797b4fc7db5de /src/util
parent2f9a0945bfeee3296cec3d38d094e4c49f9cb65f (diff)
downloadcamu-60b4ebfbf3be78dba9dc7c65ab2bdaa0b218c0c2.tar.gz
camu-60b4ebfbf3be78dba9dc7c65ab2bdaa0b218c0c2.tar.bz2
camu-60b4ebfbf3be78dba9dc7c65ab2bdaa0b218c0c2.zip
Everything before initial synced list
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/color_palette.c15
-rw-r--r--src/util/meson.build3
2 files changed, 13 insertions, 5 deletions
diff --git a/src/util/color_palette.c b/src/util/color_palette.c
index 53c2c68..3bc7f3e 100644
--- a/src/util/color_palette.c
+++ b/src/util/color_palette.c
@@ -1,9 +1,8 @@
-#include <aki/file.h>
-#include <jansson.h>
-
#include "color_palette.h"
-struct camu_color_palette global_color_palette = {0};
+#ifdef AKIYO_HAS_JSON
+#include <aki/file.h>
+#include <jansson.h>
static char *special_colors[2] = {
"background",
@@ -28,9 +27,13 @@ static char *normal_colors[16] = {
"color14",
"color15"
};
+#endif
+
+struct camu_color_palette global_color_palette = { 0 };
bool camu_color_palette_init(str *path)
{
+#ifdef AKIYO_HAS_JSON
struct aki_file file;
if (!aki_file_open(&file, path, 0)) {
return false;
@@ -59,4 +62,8 @@ bool camu_color_palette_init(str *path)
global_color_palette.colors[i + 2] = (u32)al_str_to_long(al_str_w((char *)color, 1, 6), 16);
}
return true;
+#else
+ (void)path;
+ return false;
+#endif
}
diff --git a/src/util/meson.build b/src/util/meson.build
index eff0fe6..1d62f55 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -1,6 +1,7 @@
util_src = ['color_palette.c', 'blocking_ring_buffer.c']
blake3_opts = cmake.subproject_options()
-blake3_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : 'Release' })
+reltype = is_minsize ? 'MinSizeRel' : 'Release'
+blake3_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : reltype })
blake3 = cmake.subproject('BLAKE3').dependency('blake3')
util_deps = [blake3]
util = declare_dependency(sources: util_src, dependencies: util_deps)