9#include <entropic/entropic_config.h>
19namespace entropic::config {
44 || info.dli_fname ==
nullptr) {
47 auto lib_path = std::filesystem::path(info.dli_fname);
57 return abs_lib.parent_path().parent_path() /
"share" /
"entropic";
84 std::filesystem::path path;
91 if (
const char* env = std::getenv(
"ENTROPIC_DATA_DIR"); env && *env) {
92 candidates.push_back({env,
"ENTROPIC_DATA_DIR env"});
96 if (!
config.config_dir.empty()) {
108 candidates.push_back({
"data",
"CWD-relative (dev fallback)"});
110 std::filesystem::path result;
112 if (std::filesystem::is_directory(path)) {
113 s_log->info(
"Data dir from {}: {}",
label, path.string());
119 if (result.empty()) {
120 s_log->warn(
"No data directory found — bundled files unavailable");
static std::filesystem::path share_dir_from_library()
Locate librentropic.so on disk and derive its sibling share dir.
Config loader — YAML to C++ structs with validation.
ENTROPIC_EXPORT std::filesystem::path resolve_data_dir(const ParsedConfig &config)
Resolve the bundled data directory.
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
@ optional
optional: every escape asks the host's path approver
std::string config
–config FILE
Full parsed configuration.