script: 1.add xp build bat. 2.fix Qt6 compile.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -36,3 +36,4 @@ cmake-*
|
|||||||
.idea
|
.idea
|
||||||
.vs
|
.vs
|
||||||
.cache
|
.cache
|
||||||
|
xpbuild
|
||||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -24,16 +24,12 @@
|
|||||||
"-Wno-dev"
|
"-Wno-dev"
|
||||||
],
|
],
|
||||||
"cmake.environment": {
|
"cmake.environment": {
|
||||||
"QT_LIB_ROOT": "C:/Qt/Qt5.6.3/5.6.3/mingw49_32",
|
"QT_LIB_ROOT": "D:/Dev/Qt6/msvc2022_64",
|
||||||
"PATH": "${env:PATH};C:/Qt/Qt5.6.3/5.6.3/mingw49_32/bin"
|
"PATH": "${env:PATH};D:/Dev/Qt6/msvc2022_64/bin"
|
||||||
},
|
},
|
||||||
// "cmake.environment": {
|
|
||||||
// "QT_LIB_ROOT": "C:/Qt/Qt5.14.2/5.14.2/msvc2017_64",
|
|
||||||
// "PATH": "${env:PATH};C:/Qt/Qt5.14.2/5.14.2/msvc2017_64/bin"
|
|
||||||
// },
|
|
||||||
"cmake.configureSettings": {
|
"cmake.configureSettings": {
|
||||||
"CMAKE_PREFIX_PATH": "${env:QT_LIB_ROOT}",
|
"CMAKE_PREFIX_PATH": "${env:QT_LIB_ROOT}",
|
||||||
"XP_PLATFORM_SUPPORT": "ON"
|
"QT_DEFAULT_MAJOR_VERSION": "6",
|
||||||
},
|
},
|
||||||
"cmake.options.statusBarVisibility": "visible",
|
"cmake.options.statusBarVisibility": "visible",
|
||||||
"cmake.generator": "Ninja",
|
"cmake.generator": "Ninja",
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ set(CMAKE_CXX_STANDARD 11)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
set(PROJECT_URL "https://github.com/taynpg/frelay")
|
set(PROJECT_URL "https://github.com/taynpg/frelay")
|
||||||
set(QT_DEFAULT_MAJOR_VERSION 5)
|
|
||||||
|
if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION)
|
||||||
|
set(QT_DEFAULT_MAJOR_VERSION 6)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(QAPPLICATION_CLASS QApplication)
|
set(QAPPLICATION_CLASS QApplication)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
@@ -20,7 +24,8 @@ endif()
|
|||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(DEFINED XP_PLATFORM_SUPPORT)
|
if(DEFINED XP_PLATFORM_SUPPORT)
|
||||||
message(STATUS "Support Windows XP platform.")
|
message(STATUS "Support Windows XP platform => ${XP_PLATFORM_SUPPORT}.")
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/Gui/Control)
|
||||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||||
else()
|
else()
|
||||||
add_definitions(-D_WIN32_WINNT=0x0601)
|
add_definitions(-D_WIN32_WINNT=0x0601)
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ void ClientCore::DoConnect(const QString& ip, quint16 port)
|
|||||||
|
|
||||||
bool ClientCore::Connect(const QString& ip, quint16 port)
|
bool ClientCore::Connect(const QString& ip, quint16 port)
|
||||||
{
|
{
|
||||||
|
if (connected_) {
|
||||||
|
qInfo() << QString(tr("already connected."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
socket_->connectToHost(ip, port);
|
socket_->connectToHost(ip, port);
|
||||||
if (!socket_->waitForConnected(3000)) {
|
if (!socket_->waitForConnected(3000)) {
|
||||||
qCritical() << QString(tr("%1:%2 connect failed...")).arg(ip).arg(port);
|
qCritical() << QString(tr("%1:%2 connect failed...")).arg(ip).arg(port);
|
||||||
|
|||||||
@@ -26,12 +26,14 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool SendFrame(QSharedPointer<FrameBuffer> frame);
|
bool SendFrame(QSharedPointer<FrameBuffer> frame);
|
||||||
|
void Disconnect();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void DoConnect(const QString& ip, quint16 port);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Instance();
|
void Instance();
|
||||||
bool Connect(const QString& ip, quint16 port);
|
bool Connect(const QString& ip, quint16 port);
|
||||||
void DoConnect(const QString& ip, quint16 port);
|
|
||||||
void Disconnect();
|
|
||||||
bool Send(QSharedPointer<FrameBuffer> frame);
|
bool Send(QSharedPointer<FrameBuffer> frame);
|
||||||
bool Send(const char* data, qint64 len);
|
bool Send(const char* data, qint64 len);
|
||||||
bool IsConnect();
|
bool IsConnect();
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ void Connecter::RunWorker(ClientCore* clientCore)
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(this, &Connecter::sigDoConnect, clientCore_, &ClientCore::DoConnect);
|
connect(this, &Connecter::sigDoConnect, clientCore_, &ClientCore::DoConnect);
|
||||||
connect(this, &Connecter::sigDisConnect, clientCore_, &ClientCore::Disconnect);
|
connect(this, &Connecter::sigDisConnect, this,
|
||||||
|
[this]() { QMetaObject::invokeMethod(clientCore_, "Disconnect", Qt::QueuedConnection); });
|
||||||
connect(sockWorker_, &QThread::finished, sockWorker_, &QObject::deleteLater);
|
connect(sockWorker_, &QThread::finished, sockWorker_, &QObject::deleteLater);
|
||||||
|
|
||||||
heatBeat_->start();
|
heatBeat_->start();
|
||||||
|
|||||||
37
Script/xpbuild.bat
Normal file
37
Script/xpbuild.bat
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
@echo on
|
||||||
|
|
||||||
|
set QT_563_ROOT=C:\Qt\Qt5.6.3
|
||||||
|
set QT_DIRS="%QT_563_ROOT%\5.6.3\mingw49_32"
|
||||||
|
set QT_GCC_ROOT="%QT_563_ROOT%\Tools\mingw49_32\bin"
|
||||||
|
|
||||||
|
set MINGWDLL1="%QT_563_ROOT%\Tools\mingw492_32\bin\libgcc_s_dw2-1.dll"
|
||||||
|
set MINGWDLL2="%QT_563_ROOT%\Tools\mingw492_32\bin\libstdc++-6.dll"
|
||||||
|
set MINGWDLL3="%QT_563_ROOT%\Tools\mingw492_32\bin\libwinpthread-1.dll"
|
||||||
|
set QTDLL1="%QT_563_ROOT%\5.6.3\mingw49_32\bin\Qt5Core.dll"
|
||||||
|
set QTDLL2="%QT_563_ROOT%\5.6.3\mingw49_32\bin\Qt5Gui.dll"
|
||||||
|
set QTDLL3="%QT_563_ROOT%\5.6.3\mingw49_32\bin\Qt5Widgets.dll"
|
||||||
|
set QTDLL4="%QT_563_ROOT%\5.6.3\mingw49_32\bin\Qt5Network.dll"
|
||||||
|
set QTDLL5="%QT_563_ROOT%\5.6.3\mingw49_32\plugins\platforms\qwindows.dll"
|
||||||
|
|
||||||
|
set PAHT=%PATH%;%QT_GCC_ROOT%;
|
||||||
|
|
||||||
|
cmake -B"%~dp0..\xpbuild" -S"%~dp0.." -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_DIRS% -DQT_DEFAULT_MAJOR_VERSION=5 -DXP_PLATFORM_SUPPORT=ON
|
||||||
|
cmake --build "%~dp0..\xpbuild" --config Release
|
||||||
|
|
||||||
|
if %errorlevel% equ 0 (
|
||||||
|
if not exist "%~dp0..\xpbuild\bin\Release\platforms" (
|
||||||
|
mkdir "%~dp0..\xpbuild\bin\Release\platforms"
|
||||||
|
)
|
||||||
|
xcopy /Y %MINGWDLL1% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %MINGWDLL2% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %MINGWDLL3% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %QTDLL1% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %QTDLL2% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %QTDLL3% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %QTDLL4% "%~dp0..\xpbuild\bin\Release"
|
||||||
|
xcopy /Y %QTDLL5% "%~dp0..\xpbuild\bin\Release\platforms"
|
||||||
|
del /f /q "%~dp0..\xpbuild\bin\Release\frelayBaseTest.exe"
|
||||||
|
del /f /q "%~dp0..\xpbuild\bin\Release\frelayTest.exe"
|
||||||
|
)
|
||||||
|
|
||||||
|
pause
|
||||||
@@ -132,7 +132,7 @@ void UseExceptionHandler(EXCEPTION_POINTERS* exception)
|
|||||||
QString fullPath = QDir(h.dumpSavePath_).absoluteFilePath(dumpName);
|
QString fullPath = QDir(h.dumpSavePath_).absoluteFilePath(dumpName);
|
||||||
QString fullFailedPath = QDir(h.dumpSavePath_).absoluteFilePath(dumpFailedLog);
|
QString fullFailedPath = QDir(h.dumpSavePath_).absoluteFilePath(dumpFailedLog);
|
||||||
|
|
||||||
HANDLE hFile = CreateFile(fullPath.toStdString().c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
HANDLE hFile = CreateFileA(fullPath.toStdString().c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (hFile == INVALID_HANDLE_VALUE) {
|
if (hFile == INVALID_HANDLE_VALUE) {
|
||||||
QFile file(fullFailedPath);
|
QFile file(fullFailedPath);
|
||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user