mirror of
https://github.com/libretro/RetroArch
synced 2024-07-05 09:48:42 +00:00
Add compile option to make unix use cwd as env (#12989)
Setting UNIX_CWD_ENV to 1 when compiling with the unix platform will make the base path for the env the cwd. This is to be able to match the behavior on Windows.
This commit is contained in:
parent
249e24fbe7
commit
6a59dad08c
|
@ -188,6 +188,10 @@ endif
|
||||||
|
|
||||||
ifeq ($(HAVE_UNIX), 1)
|
ifeq ($(HAVE_UNIX), 1)
|
||||||
OBJ += frontend/drivers/platform_unix.o
|
OBJ += frontend/drivers/platform_unix.o
|
||||||
|
|
||||||
|
ifeq ($(UNIX_CWD_ENV), 1)
|
||||||
|
DEF_FLAGS += -DRARCH_UNIX_CWD_ENV
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET), retroarch_3ds)
|
ifeq ($(TARGET), retroarch_3ds)
|
||||||
|
|
|
@ -107,6 +107,9 @@ bool fill_pathname_application_data(char *s, size_t len)
|
||||||
"Library/Application Support/RetroArch", len);
|
"Library/Application Support/RetroArch", len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#elif defined(RARCH_UNIX_CWD_ENV)
|
||||||
|
getcwd(s, len);
|
||||||
|
return true;
|
||||||
#elif defined(DINGUX)
|
#elif defined(DINGUX)
|
||||||
dingux_get_base_path(s, len);
|
dingux_get_base_path(s, len);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1792,7 +1792,10 @@ static void frontend_unix_get_env(int *argc,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char base_path[PATH_MAX] = {0};
|
char base_path[PATH_MAX] = {0};
|
||||||
#if defined(DINGUX)
|
#if defined(RARCH_UNIX_CWD_ENV)
|
||||||
|
/* The entire path is zero initialized. */
|
||||||
|
base_path[0] = '.';
|
||||||
|
#elif defined(DINGUX)
|
||||||
dingux_get_base_path(base_path, sizeof(base_path));
|
dingux_get_base_path(base_path, sizeof(base_path));
|
||||||
#else
|
#else
|
||||||
const char *xdg = getenv("XDG_CONFIG_HOME");
|
const char *xdg = getenv("XDG_CONFIG_HOME");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user