Fixes for Haiku support, compliments of Chris Roberts.
This commit is contained in:
parent
1c8bdd8fb4
commit
f6ec56cf59
|
@ -108,7 +108,9 @@ IF(BEOS)
|
||||||
# We add this explicitly, since we don't want CMake to think this
|
# We add this explicitly, since we don't want CMake to think this
|
||||||
# is a C++ project unless we're on BeOS.
|
# is a C++ project unless we're on BeOS.
|
||||||
SET(PHYSFS_BEOS_SRCS platform/beos.cpp)
|
SET(PHYSFS_BEOS_SRCS platform/beos.cpp)
|
||||||
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} be root)
|
FIND_LIBRARY(BE_LIBRARY be)
|
||||||
|
FIND_LIBRARY(ROOT_LIBRARY root)
|
||||||
|
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
|
||||||
ENDIF(BEOS)
|
ENDIF(BEOS)
|
||||||
|
|
||||||
# Almost everything is "compiled" here, but things that don't apply to the
|
# Almost everything is "compiled" here, but things that don't apply to the
|
||||||
|
@ -298,7 +300,8 @@ IF(PHYSFS_BUILD_TEST)
|
||||||
FIND_PATH(READLINE_H readline/readline.h)
|
FIND_PATH(READLINE_H readline/readline.h)
|
||||||
FIND_PATH(HISTORY_H readline/history.h)
|
FIND_PATH(HISTORY_H readline/history.h)
|
||||||
IF(READLINE_H AND HISTORY_H)
|
IF(READLINE_H AND HISTORY_H)
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES curses)
|
FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||||
FIND_LIBRARY(READLINE_LIBRARY readline)
|
FIND_LIBRARY(READLINE_LIBRARY readline)
|
||||||
FIND_LIBRARY(HISTORY_LIBRARY history)
|
FIND_LIBRARY(HISTORY_LIBRARY history)
|
||||||
IF(READLINE_LIBRARY AND HISTORY_LIBRARY)
|
IF(READLINE_LIBRARY AND HISTORY_LIBRARY)
|
||||||
|
|
|
@ -174,14 +174,17 @@ static team_id getTeamID(void)
|
||||||
|
|
||||||
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
|
||||||
{
|
{
|
||||||
/* in case there isn't a BApplication yet, we'll construct a roster. */
|
image_info info;
|
||||||
BRoster roster;
|
int32 cookie = 0;
|
||||||
app_info info;
|
|
||||||
status_t rc = roster.GetRunningAppInfo(getTeamID(), &info);
|
while (get_next_image_info(0, &cookie, &info) == B_OK) {
|
||||||
BAIL_IF_MACRO(rc < B_OK, strerror(rc), NULL);
|
if (info.type == B_APP_IMAGE)
|
||||||
BEntry entry(&(info.ref), true);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
BEntry entry(info.name, true);
|
||||||
BPath path;
|
BPath path;
|
||||||
rc = entry.GetPath(&path); /* (path) now has binary's path. */
|
status_t rc = entry.GetPath(&path); /* (path) now has binary's path. */
|
||||||
assert(rc == B_OK);
|
assert(rc == B_OK);
|
||||||
rc = path.GetParent(&path); /* chop filename, keep directory. */
|
rc = path.GetParent(&path); /* chop filename, keep directory. */
|
||||||
assert(rc == B_OK);
|
assert(rc == B_OK);
|
||||||
|
|
Loading…
Reference in New Issue