Add hacks to make it build on MacOS 12.3

you need to install icu4c in brew
This commit is contained in:
RigoLigo 2022-05-23 01:34:38 +08:00 committed by RigoLigo
parent c56a020781
commit 6cb2fb15eb
8 changed files with 44 additions and 6 deletions

View File

@ -13,7 +13,13 @@ isEmpty(APP_VERSION) {
APP_VERSION=1.0.8
}
macos: {
# This package needs to be installed via homebrew before we can compile it
INCLUDEPATH += \
/opt/homebrew/opt/icu4c/include
QT += gui-private
}
win32: VERSION = $${APP_VERSION}.0
else: VERSION = $${APP_VERSION}

View File

@ -52,7 +52,7 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mPainting = false;
#ifdef Q_OS_WIN
mFontDummy = QFont("Consolas",12);
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
mFontDummy = QFont("terminal",14);
#else
#error "Not supported!"

View File

@ -185,15 +185,20 @@ QString Settings::Dirs::appResourceDir() const
return appDir();
#elif defined(Q_OS_LINUX)
return includeTrailingPathDelimiter(PREFIX)+"share/"+APP_NAME;
#elif defined(Q_OS_MACOS)
return "";
#endif
}
QString Settings::Dirs::appLibexecDir() const
{
#ifdef Q_OS_WIN
return appDir();
#elif defined(Q_OS_LINUX)
return includeTrailingPathDelimiter(PREFIX)+"libexec/"+APP_NAME;
#elif defined(Q_OS_MACOS)
return "";
#endif
}

View File

@ -50,6 +50,21 @@
#define CLANG_PROGRAM "clang"
#define CLANG_CPP_PROGRAM "clang++"
#define LLDB_MI_PROGRAM "lldb-mi"
#elif defined(Q_OS_MACOS)
#define GCC_PROGRAM "gcc"
#define GPP_PROGRAM "g++"
#define GDB_PROGRAM "gdb"
#define GDB_SERVER_PROGRAM "gdbserver"
#define GDB32_PROGRAM "gdb32"
#define MAKE_PROGRAM "make"
#define WINDRES_PROGRAM ""
#define GPROF_PROGRAM "gprof"
#define CLEAN_PROGRAM "rm -rf"
#define CPP_PROGRAM "cpp"
#define GIT_PROGRAM "git"
#define CLANG_PROGRAM "clang"
#define CLANG_CPP_PROGRAM "clang++"
#define LLDB_MI_PROGRAM "lldb-mi"
#else
#error "Only support windows and linux now!"
#endif
@ -85,7 +100,7 @@
# define DYNAMIC_LIB_EXT "dll"
# define MAKEFILE_NAME "makefile.win"
# define ALL_FILE_WILDCARD "*.*"
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
# define PATH_SENSITIVITY Qt::CaseSensitive
# define PATH_SEPARATOR ":"
# define LINE_BREAKER "\n"

View File

@ -27,6 +27,11 @@
#include <QSvgRenderer>
#include "../settings.h"
#if defined(Q_OS_MACX)
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformtheme.h>
#endif
#define BEGIN_STYLE_PIXMAPCACHE(a) \
QRect rect = option->rect; \
QPixmap internalPixmapCache; \

View File

@ -10,7 +10,7 @@ SUBDIRS += \
redpanda-win-git-askpass
}
linux: {
macos,linux: {
SUBDIRS += \
redpanda-git-askpass
}

View File

@ -19,10 +19,15 @@ SOURCES += \
unix: {
SOURCES += \
main.unix.cpp
LIBS+= \
-lrt
}
# macOS does not provide rt library, only use it for Linux
linux: {
LIBS+= \
-lrt
}
CONFIG += lrelease
CONFIG += embed_translations

View File

@ -109,7 +109,9 @@ int ExecuteCommand(vector<string>& command,bool reInp) {
if (result) {
printf("Failed to start command %s %s!\n",path_to_command.c_str(), file.c_str());
printf("errno %d: %s\n",errno,strerror(errno));
printf("current dir: %s",get_current_dir_name());
char* current_dir = getcwd(nullptr, 0);
printf("current dir: %s",current_dir);
free(current_dir);
exit(-1);
}
} else {