mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-03 05:28:53 +02:00
59 lines
1.4 KiB
Diff
59 lines
1.4 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index ef6577f..b7631b7 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -23,6 +23,10 @@ elseif ()
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-enforce-eh-specs")
|
|
endif ()
|
|
|
|
+if(HAIKU)
|
|
+ set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS}" "-lbe")
|
|
+endif()
|
|
+
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -g0")
|
|
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
diff --git a/src/Settings.cpp b/src/Settings.cpp
|
|
index 8beaeed..c22cc09 100644
|
|
--- a/src/Settings.cpp
|
|
+++ b/src/Settings.cpp
|
|
@@ -34,6 +34,12 @@ using namespace std;
|
|
#include "UtilsFileSystem.h"
|
|
#include "SharedResources.h"
|
|
|
|
+#ifdef __HAIKU__
|
|
+#include <String.h>
|
|
+#include <Path.h>
|
|
+#include <FindDirectory.h>
|
|
+#endif
|
|
+
|
|
#ifdef _MSC_VER
|
|
#define log2(x) logf(x)/logf(2)
|
|
#endif
|
|
@@ -232,6 +238,25 @@ void setPaths() {
|
|
if (dirExists(CUSTOM_PATH_DATA)) PATH_DATA = CUSTOM_PATH_DATA;
|
|
else if (!CUSTOM_PATH_DATA.empty()) fprintf(stderr, "Error: Could not find specified game data directory.\n");
|
|
}
|
|
+
|
|
+#elif __HAIKU__
|
|
+// Haiku paths
|
|
+void setPaths() {
|
|
+ BPath path;
|
|
+ find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
|
+ BString str = path.Path();
|
|
+ str << "/flare/";
|
|
+ createDir(str.String());
|
|
+ PATH_CONF = str;
|
|
+ PATH_USER = str;
|
|
+ PATH_DEFAULT_USER = str;
|
|
+ find_directory(B_SYSTEM_DATA_DIRECTORY, &path);
|
|
+ str = path.Path();
|
|
+ str << "/flare/";
|
|
+ PATH_DATA = str;
|
|
+ PATH_DEFAULT_DATA = str;
|
|
+}
|
|
+
|
|
#else
|
|
void setPaths() {
|
|
|