Skip to content

Commit adafcb4

Browse files
committed
nall: Use the value of datadir to find the assets dir.
1 parent 8a6b89d commit adafcb4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

bsnes/target-bsnes/bsnes.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ auto locate(string name) -> string {
1212
location = {Path::userData(), "bsnes/", name};
1313
if(inode::exists(location)) return location;
1414

15+
location = {Path::sharedData(), "bsnes/", name};
16+
if(inode::exists(location)) return location;
17+
1518
directory::create({Path::userSettings(), "bsnes/"});
1619
return {Path::userSettings(), "bsnes/", name};
1720
}

nall/GNUmakefile

+1
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,5 @@ else
243243
bindir ?= $(prefix)/bin
244244
datarootdir ?= $(prefix)/share
245245
datadir ?= $(datarootdir)
246+
flags += -DDATADIR=\"$(datadir)\"
246247
endif

nall/path.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ inline auto sharedData() -> string {
137137
result.transform("\\", "/");
138138
#elif defined(PLATFORM_MACOS)
139139
string result = "/Library/Application Support/";
140+
#elif defined(DATADIR)
141+
string result = DATADIR;
140142
#else
141143
string result = "/usr/share/";
142144
#endif

0 commit comments

Comments
 (0)