summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/color_palette.h14
-rw-r--r--src/util/meson.build5
2 files changed, 16 insertions, 3 deletions
diff --git a/src/util/color_palette.h b/src/util/color_palette.h
index 7330135..b0cc9f4 100644
--- a/src/util/color_palette.h
+++ b/src/util/color_palette.h
@@ -2,6 +2,7 @@
#include <al/types.h>
#include <al/str.h>
+#include <nnwt/file.h>
enum {
CAMU_COLOR_BACKGROUND = 0,
@@ -33,3 +34,16 @@ struct camu_color_palette {
extern struct camu_color_palette global_color_palette;
bool camu_colors_maybe_init(str *path);
+
+static inline void camu_colors_default_init()
+{
+ char *home_env = getenv("HOME");
+ if (home_env) {
+ str color_palette;
+ al_str_from(&color_palette, home_env);
+ nn_path_append(&color_palette, &al_str_c(".config"));
+ nn_path_append(&color_palette, &al_str_c("colors.json"));
+ camu_colors_maybe_init(&color_palette);
+ al_str_free(&color_palette);
+ }
+}
diff --git a/src/util/meson.build b/src/util/meson.build
index c2c3c3d..2da5b08 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -4,9 +4,8 @@ if get_option('portal').enabled()
blake3 = dependency('libblake3', required: false, allow_fallback: false)
if not blake3.found()
blake3_opts = cmake.subproject_options()
- reltype = is_minsize ? 'MinSizeRel' : 'Release'
- blake3_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : reltype })
- blake3_opts.add_cmake_defines({ 'CMAKE_POSITION_INDEPENDENT_CODE': true })
+ blake3_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : cmake_reltype })
+ blake3_opts.add_cmake_defines({ 'CMAKE_POSITION_INDEPENDENT_CODE': is_static_shared_lib })
blake3 = cmake.subproject('BLAKE3', options: blake3_opts).dependency('blake3')
endif
util_deps += [blake3]