Skip to content

Commit ff35014

Browse files
committed
Fix data paths for FreeBSD
1 parent de868d2 commit ff35014

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/porting.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ void initializePaths()
154154
/*
155155
OS X
156156
*/
157-
#elif defined(__APPLE__)
157+
#elif defined(__APPLE__) || defined(__FreeBSD__)
158158

159159
//TODO: Get path of executable. This assumes working directory is bin/
160-
dstream<<"WARNING: Relative path not properly supported on OS X"
160+
dstream<<"WARNING: Relative path not properly supported on OS X and FreeBSD"
161161
<<std::endl;
162162
path_data = std::string("../data");
163163
path_userdata = std::string("../");
@@ -244,6 +244,11 @@ void initializePaths()
244244
CFRelease(resources_url);
245245

246246
path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + APPNAME;
247+
248+
#elif defined(__FreeBSD__)
249+
250+
path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
251+
path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
247252

248253
#endif
249254

0 commit comments

Comments
 (0)