Support macOS bundling for binary distribution

This commit is contained in:
vit9696 2018-11-24 03:27:33 +03:00 committed by Ivan
parent c50d459b1e
commit 5a40c1802b
9 changed files with 109 additions and 39 deletions

View file

@ -1376,10 +1376,16 @@ const std::string& fs::get_config_dir()
dir.resize(dir.rfind('/') + 1);
#else
#ifdef __APPLE__
if (const char* home = ::getenv("HOME"))
dir = home + "/Library/Application Support"s;
#else
if (const char* home = ::getenv("XDG_CONFIG_HOME"))
dir = home;
else if (const char* home = ::getenv("HOME"))
dir = home + "/.config"s;
#endif
else // Just in case
dir = "./config";