compile and run on Windows

This commit is contained in:
mrexodia 2017-03-30 05:07:34 +02:00
parent a42db155ea
commit b26d506b58
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
5 changed files with 43 additions and 7 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "iaito_win32"]
path = iaito_win32
url = https://github.com/mrexodia/iaito_win32

1
iaito_win32 Submodule

@ -0,0 +1 @@
Subproject commit bdacfe0a3b44cca6b2c4f7a35228fd3343fc471f

View File

@ -10,7 +10,11 @@ ICON = img/Enso.icns
TEMPLATE = app TEMPLATE = app
# The application version # The application version
win32 {
VERSION = 1.0
} else {
VERSION = 1.0-dev VERSION = 1.0-dev
}
# Define the preprocessor macro to get the application version in our application. # Define the preprocessor macro to get the application version in our application.
DEFINES += APP_VERSION=\\\"$$VERSION\\\" DEFINES += APP_VERSION=\\\"$$VERSION\\\"
@ -36,6 +40,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = iaito TARGET = iaito
TEMPLATE = app TEMPLATE = app
INCLUDEPATH += ./
SOURCES += main.cpp\ SOURCES += main.cpp\
mainwindow.cpp \ mainwindow.cpp \
newfiledialog.cpp \ newfiledialog.cpp \
@ -130,8 +136,22 @@ FORMS += mainwindow.ui \
RESOURCES += \ RESOURCES += \
resources.qrc resources.qrc
win32 {
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _CRT_SECURE_NO_WARNINGS
INCLUDEPATH += "$$PWD/../iaito_win32/include"
INCLUDEPATH += "$$PWD/../iaito_win32/radare2/include/libr"
!contains(QMAKE_HOST.arch, x86_64) {
LIBS += -L"$$PWD/../iaito_win32/radare2/lib32"
} else {
LIBS += -L"$$PWD/../iaito_win32/radare2/lib64"
}
} else {
#INCLUDEPATH += /usr/local/radare2/osx/include/libr #INCLUDEPATH += /usr/local/radare2/osx/include/libr
INCLUDEPATH += /usr/local/include/libr INCLUDEPATH += /usr/local/include/libr
INCLUDEPATH += /usr/include/libr INCLUDEPATH += /usr/include/libr
#LIBS += -L/usr/local/radare2/osx/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto #LIBS += -L/usr/local/radare2/osx/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto
LIBS += -L/usr/local/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto LIBS += -L/usr/local/lib
}
LIBS += -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto

View File

@ -136,7 +136,8 @@ QString QRCore::cmd(const QString &str) {
//r_cons_flush(); //r_cons_flush();
char *res = r_core_cmd_str (this->core, cmd); char *res = r_core_cmd_str (this->core, cmd);
QString o = (res && *res)? QString::fromUtf8(res): QString(); QString o = (res && *res)? QString::fromUtf8(res): QString();
free (res); //r_mem_free was added in https://github.com/radare/radare2/commit/cd28744049492dc8ac25a1f2b3ba0e42f0e9ce93
r_mem_free(res);
return o; return o;
} }

View File

@ -6,8 +6,19 @@
#include <QObject> #include <QObject>
#include <QStringList> #include <QStringList>
#include <QMessageBox> #include <QMessageBox>
//Workaround for compile errors on Windows
#ifdef _WIN32
#include <r2hacks.h>
#endif //_WIN32
#include "r_core.h" #include "r_core.h"
//Workaround for compile errors on Windows.
#ifdef _WIN32
#undef min
#endif //_WIN32
#define HAVE_LATEST_LIBR2 false #define HAVE_LATEST_LIBR2 false
#define QRListForeach(list, it, type, x) \ #define QRListForeach(list, it, type, x) \