build: change to xmake mgr.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -36,4 +36,6 @@ cmake-*
|
||||
.idea
|
||||
.vs
|
||||
.cache
|
||||
xpbuild
|
||||
xpbuild
|
||||
.xmake
|
||||
compile_commands.json
|
||||
41
.vscode/settings.json
vendored
41
.vscode/settings.json
vendored
@@ -3,41 +3,14 @@
|
||||
"editor.fontSize": 14,
|
||||
// "editor.fontFamily": "'Source Code Pro', 'Source Code Pro', 'Source Code Pro'",
|
||||
"terminal.integrated.fontFamily": "Source Code Pro",
|
||||
"cmake.configureOnOpen": true,
|
||||
"cmake.debugConfig": {
|
||||
"console": "integratedTerminal",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "-gdb-set charset utf-8",
|
||||
"text": "-gdb-set charset UTF-8"
|
||||
},
|
||||
{
|
||||
"description": "Enable gdb pretty-printing",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"visualizerFile": "${workspaceRoot}/.vscode/qt5.natvis",
|
||||
"args": ["127.0.0.1", "9009"]
|
||||
},
|
||||
"cmake.configureArgs": [
|
||||
"-Wno-dev"
|
||||
],
|
||||
"cmake.environment": {
|
||||
"QT_LIB_ROOT": "/home/yun/Qt5.14.2/5.14.2/gcc_64",
|
||||
"PATH": "${env:PATH};/home/yun/Qt5.14.2/5.14.2/gcc_64/bin"
|
||||
},
|
||||
"cmake.configureSettings": {
|
||||
"CMAKE_PREFIX_PATH": "${env:QT_LIB_ROOT}",
|
||||
"QT_DEFAULT_MAJOR_VERSION": "5",
|
||||
"COMPILE_GUI": "ON"
|
||||
},
|
||||
"cmake.options.statusBarVisibility": "visible",
|
||||
"cmake.generator": "Ninja",
|
||||
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
|
||||
"C_Cpp.default.cppStandard": "c++17",
|
||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
|
||||
"cmake.configureOnOpen": false,
|
||||
"C_Cpp.default.compileCommands": "${workspaceRoot}/.vscode/compile_commands.json",
|
||||
"C_Cpp.default.cppStandard": "c++11",
|
||||
"editor.inlayHints.enabled": "off",
|
||||
"xmake.additionalConfigArguments": [
|
||||
"--qt=C:/Qt/6.8.3",
|
||||
"--gui=y"
|
||||
],
|
||||
"editor.unicodeHighlight.allowedLocales": {
|
||||
"ja": true,
|
||||
"zh-hant": true,
|
||||
|
||||
31
3rd/SingleApplication-3.5.2/xmake.lua
Normal file
31
3rd/SingleApplication-3.5.2/xmake.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("SingleApplication")
|
||||
add_rules("qt.static")
|
||||
if has_config("single5") then
|
||||
add_defines("QT_DEFAULT_MAJOR_VERSION=5")
|
||||
else
|
||||
add_defines("QT_DEFAULT_MAJOR_VERSION=6")
|
||||
end
|
||||
-- QApplication/QGuiApplication/QCoreApplication
|
||||
add_defines("QAPPLICATION_CLASS=QApplication")
|
||||
add_defines("QT_NO_CAST_TO_ASCII")
|
||||
add_defines("QT_NO_CAST_FROM_ASCII")
|
||||
add_defines("QT_NO_URL_CAST_FROM_STRING")
|
||||
add_defines("QT_NO_CAST_FROM_BYTEARRAY")
|
||||
add_defines("QT_USE_QSTRINGBUILDER")
|
||||
add_defines("QT_NO_NARROWING_CONVERSIONS_IN_CONNECT")
|
||||
add_defines("QT_NO_KEYWORDS")
|
||||
add_defines("QT_NO_FOREACH")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("*.h")
|
||||
add_files("*.cpp")
|
||||
add_frameworks("QtCore")
|
||||
add_frameworks("QtGui")
|
||||
add_frameworks("QtWidgets")
|
||||
add_frameworks("QtNetwork")
|
||||
|
||||
option("single5")
|
||||
set_default(false)
|
||||
set_showmenu(true)
|
||||
set_description("SingleApplication Build with Qt5.")
|
||||
@@ -1,81 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(frelay VERSION 0.2.1 LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(PROJECT_URL "https://github.com/taynpg/frelay")
|
||||
|
||||
if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION)
|
||||
set(QT_DEFAULT_MAJOR_VERSION 6)
|
||||
endif()
|
||||
|
||||
set(QAPPLICATION_CLASS QApplication)
|
||||
|
||||
if (MSVC)
|
||||
add_compile_options(/utf-8)
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_PREFIX_PATH)
|
||||
message(STATUS "CMAKE_PREFIX_PATH => ${CMAKE_PREFIX_PATH}.")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
message(STATUS "frelay use MINGW compiler.")
|
||||
set(COMPILER_USE_MINGW ON)
|
||||
add_definitions(-DCOMPILER_USE_MINGW)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(DEFINED XP_PLATFORM_SUPPORT)
|
||||
message(STATUS "Support Windows XP platform => ${XP_PLATFORM_SUPPORT}.")
|
||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
else()
|
||||
add_definitions(-D_WIN32_WINNT=0x0601)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Gui/Control)
|
||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/)
|
||||
include_directories(${PROJECT_BINARY_DIR})
|
||||
|
||||
add_definitions(-DFMT_HEADER_ONLY)
|
||||
include_directories(3rd)
|
||||
|
||||
if(NOT DEFINED COMPILER_USE_MINGW)
|
||||
add_subdirectory(crashelper)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Protocol)
|
||||
add_subdirectory(Server)
|
||||
add_subdirectory(ClientCore)
|
||||
|
||||
add_subdirectory(Util)
|
||||
if(DEFINED COMPILE_GUI)
|
||||
message(STATUS "Support Gui Part => ${COMPILE_GUI}.")
|
||||
add_subdirectory(3rd/SingleApplication-3.5.2)
|
||||
add_subdirectory(Gui)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Console)
|
||||
add_subdirectory(Struct)
|
||||
add_subdirectory(Test)
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE VERSION_GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE VERSION_GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
configure_file(version.h.in fversion.h)
|
||||
message(STATUS "${CMAKE_SYSTEM_NAME} build dir:${PROJECT_BINARY_DIR}")
|
||||
message(STATUS "VERSION_GIT_BRANCH: ${VERSION_GIT_BRANCH}")
|
||||
message(STATUS "VERSION_GIT_HASH: ${VERSION_GIT_HASH}")
|
||||
@@ -1,31 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(ClientCore LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
|
||||
|
||||
set(SOURCES
|
||||
ClientCore.cpp
|
||||
ClientCore.h
|
||||
RemoteFile.h
|
||||
RemoteFile.cpp
|
||||
FileTrans.h
|
||||
FileTrans.cpp
|
||||
)
|
||||
|
||||
add_library(ClientCore STATIC ${SOURCES})
|
||||
target_link_libraries(ClientCore PRIVATE Protocol
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Struct
|
||||
Util
|
||||
)
|
||||
target_include_directories(ClientCore PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
12
ClientCore/xmake.lua
Normal file
12
ClientCore/xmake.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("ClientCore")
|
||||
add_rules("qt.static")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("*.h")
|
||||
add_files("*.cpp")
|
||||
add_frameworks("QtCore")
|
||||
add_frameworks("QtNetwork")
|
||||
add_deps("Struct")
|
||||
add_deps("Util")
|
||||
add_deps("Protocol")
|
||||
@@ -1,22 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(frelayConsole LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
|
||||
|
||||
add_executable(frelayConsole Console.h Console.cpp main.cpp ../Res/ico.rc)
|
||||
target_link_libraries(frelayConsole PRIVATE Protocol Util ClientCore)
|
||||
|
||||
if(NOT DEFINED COMPILER_USE_MINGW)
|
||||
target_link_libraries(frelayConsole PRIVATE crashelper)
|
||||
endif()
|
||||
|
||||
target_link_libraries(frelayConsole PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "Console.h"
|
||||
|
||||
#ifndef COMPILER_USE_MINGW
|
||||
#ifndef NO_CRASHELPER
|
||||
#include <crashelper.h>
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef COMPILER_USE_MINGW
|
||||
#ifndef NO_CRASHELPER
|
||||
auto configDir = Util::GetCurConfigPath("frelay");
|
||||
#ifdef _WIN32
|
||||
backward::SetDumpFileSavePath(configDir + "/dumpfile");
|
||||
|
||||
15
Console/xmake.lua
Normal file
15
Console/xmake.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("frelayConsole")
|
||||
set_rules("qt.console")
|
||||
add_files("../Res/ico.rc")
|
||||
add_files("Console.cpp", "Console.h", "main.cpp")
|
||||
add_deps("ClientCore")
|
||||
add_deps("Protocol")
|
||||
add_deps("Util")
|
||||
add_frameworks("QtNetwork")
|
||||
|
||||
if is_plat("mingw") then
|
||||
else
|
||||
add_deps("crashelper")
|
||||
end
|
||||
@@ -1,93 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(frelayGUI VERSION ${PROJECT_VERSION} LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_definitions(-DUSE_QT_GUI)
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(PROJECT_SOURCES main.cpp
|
||||
frelayGUI.cpp frelayGUI.h frelayGUI.ui
|
||||
Control/LogControl.h Control/LogControl.cpp Control/LogControl.ui
|
||||
Control/FileControl.h Control/FileControl.cpp Control/FileControl.ui
|
||||
Control/ConnectControl.h Control/ConnectControl.cpp Control/ConnectControl.ui
|
||||
Control/CompareControl.h Control/CompareControl.cpp Control/CompareControl.ui
|
||||
GuiUtil/Public.h GuiUtil/Public.cpp
|
||||
Form/Transform.h Form/Transform.cpp Form/Transform.ui
|
||||
../Res/frelay.qrc ../Res/ico.rc
|
||||
Control/cusTableWidget.cpp Control/cusTableWidget.h
|
||||
Control/cpTableWidget.h Control/cpTableWidget.cpp
|
||||
GuiUtil/Config.h GuiUtil/Config.cpp
|
||||
)
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
qt_add_executable(frelayGUI
|
||||
MANUAL_FINALIZATION
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
# Define target properties for Android with Qt 6 as:
|
||||
# set_property(TARGET frelayGUI APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
|
||||
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
||||
else()
|
||||
if(ANDROID)
|
||||
add_library(frelayGUI SHARED
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
# Define properties for Android with Qt 5 after find_package() calls as:
|
||||
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
||||
else()
|
||||
add_executable(frelayGUI
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(frelayGUI PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
ClientCore Protocol
|
||||
Util
|
||||
Struct SingleApplication::SingleApplication
|
||||
)
|
||||
|
||||
if(NOT DEFINED COMPILER_USE_MINGW)
|
||||
target_link_libraries(frelayGUI PRIVATE crashelper)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
target_link_libraries(frelayGUI PRIVATE ws2_32 wsock32)
|
||||
endif()
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||
# If you are developing for iOS or macOS you should consider setting an
|
||||
# explicit, fixed bundle identifier manually though.
|
||||
if(${QT_VERSION} VERSION_LESS 6.1.0)
|
||||
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.frelayGUI)
|
||||
endif()
|
||||
set_target_properties(frelayGUI PROPERTIES
|
||||
${BUNDLE_ID_OPTION}
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
MACOSX_BUNDLE TRUE
|
||||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS frelayGUI
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
qt_finalize_executable(frelayGUI)
|
||||
endif()
|
||||
@@ -28,7 +28,7 @@ frelayGUI::frelayGUI(QWidget* parent) : QMainWindow(parent), ui(new Ui::frelayGU
|
||||
int height = static_cast<int>(availableGeometry.height() * 0.6);
|
||||
resize(width, height);
|
||||
|
||||
setWindowTitle(QString(tr("frelay %1")).arg(VERSION_NUM));
|
||||
setWindowTitle(QString(tr("frelay %1.%2.%3.%4")).arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_ALTER).arg(VERSION_BUILD));
|
||||
|
||||
QLabel* permanent = new QLabel(this);
|
||||
permanent->setFrameStyle(QFrame::Box | QFrame::Sunken);
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
#include "frelayGUI.h"
|
||||
|
||||
#ifndef COMPILER_USE_MINGW
|
||||
#ifndef NO_CRASHELPER
|
||||
#include <crashelper.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
#ifndef COMPILER_USE_MINGW
|
||||
#ifndef NO_CRASHELPER
|
||||
auto configDir = Util::GetCurConfigPath("frelay");
|
||||
#ifdef _WIN32
|
||||
backward::SetDumpFileSavePath(configDir + "/dumpfile");
|
||||
|
||||
28
Gui/xmake.lua
Normal file
28
Gui/xmake.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("frelayGUI")
|
||||
add_rules("qt.widgetapp")
|
||||
add_defines("QAPPLICATION_CLASS=QApplication")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("Control/*.h")
|
||||
add_files("Form/*.h")
|
||||
add_files("GuiUtil/*.h")
|
||||
add_files("Control/*.cpp")
|
||||
add_files("Control/*.ui")
|
||||
add_files("Form/*.cpp")
|
||||
add_files("Form/*.ui")
|
||||
add_files("GuiUtil/*.cpp")
|
||||
add_files("*.cpp")
|
||||
add_files("*.ui")
|
||||
add_files("*.h")
|
||||
add_files("../Res/frelay.qrc")
|
||||
add_files("../Res/ico.rc")
|
||||
add_frameworks("QtCore")
|
||||
add_frameworks("QtGui")
|
||||
add_frameworks("QtNetwork")
|
||||
add_deps("Struct")
|
||||
add_deps("Protocol")
|
||||
add_deps("Util")
|
||||
add_deps("ClientCore")
|
||||
add_deps("SingleApplication")
|
||||
add_deps("crashelper")
|
||||
@@ -1,22 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(Protocol LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
set(SOURCES
|
||||
Protocol.cxx
|
||||
Protocol.h
|
||||
)
|
||||
|
||||
add_library(Protocol STATIC ${SOURCES})
|
||||
target_link_libraries(Protocol Qt${QT_VERSION_MAJOR}::Core Struct)
|
||||
target_include_directories(Protocol PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
9
Protocol/xmake.lua
Normal file
9
Protocol/xmake.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("Protocol")
|
||||
add_rules("qt.static")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("*.cxx")
|
||||
add_files("*.h")
|
||||
add_deps("Struct")
|
||||
add_frameworks("QtCore")
|
||||
@@ -1,22 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(frelayServer LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
|
||||
|
||||
add_executable(frelayServer Server.h Server.cpp main.cpp ../Res/server.rc)
|
||||
target_link_libraries(frelayServer PRIVATE Protocol Util)
|
||||
|
||||
if(NOT DEFINED COMPILER_USE_MINGW)
|
||||
target_link_libraries(frelayServer PRIVATE crashelper)
|
||||
endif()
|
||||
|
||||
target_link_libraries(frelayServer PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)
|
||||
15
Server/xmake.lua
Normal file
15
Server/xmake.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("frelayServer")
|
||||
set_rules("qt.console")
|
||||
add_files("../Res/server.rc")
|
||||
add_files("Server.cpp", "Server.h", "main.cpp")
|
||||
add_deps("ClientCore")
|
||||
add_deps("Protocol")
|
||||
add_deps("Util")
|
||||
add_frameworks("QtNetwork")
|
||||
|
||||
if is_plat("mingw") then
|
||||
else
|
||||
add_deps("crashelper")
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(Struct LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
set(SOURCES
|
||||
InfoClient.h
|
||||
InfoClient.cpp
|
||||
InfoPack.hpp
|
||||
InfoDirFile.h
|
||||
InfoDirFile.cpp
|
||||
InfoMsg.h
|
||||
InfoMsg.cpp
|
||||
)
|
||||
|
||||
add_library(Struct STATIC ${SOURCES})
|
||||
target_link_libraries(Struct Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_include_directories(Struct PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
8
Struct/xmake.lua
Normal file
8
Struct/xmake.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("Struct")
|
||||
add_rules("qt.static")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("*.h")
|
||||
add_files("*.cpp")
|
||||
add_frameworks("QtCore")
|
||||
@@ -1,24 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(frelayTest LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
set(MSOURCES
|
||||
msgTest.h msgTest.cpp
|
||||
protocolTest.cpp infoTest.h infoTest.cpp
|
||||
)
|
||||
|
||||
add_executable(frelayTest ${MSOURCES})
|
||||
target_link_libraries(frelayTest PRIVATE Protocol Util)
|
||||
|
||||
add_executable(frelayBaseTest BaseTest.cpp)
|
||||
target_link_libraries(frelayBaseTest Qt${QT_VERSION_MAJOR}::Core)
|
||||
18
Test/xmake.lua
Normal file
18
Test/xmake.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("frelayTest")
|
||||
set_rules("qt.console")
|
||||
add_files("msgTest.cpp", "msgTest.h", "protocolTest.cpp")
|
||||
add_files("infoTest.cpp", "infoTest.h")
|
||||
add_deps("ClientCore")
|
||||
add_deps("Protocol")
|
||||
add_deps("Util")
|
||||
add_frameworks("QtNetwork")
|
||||
|
||||
target("frelayBaseTest")
|
||||
set_rules("qt.console")
|
||||
add_files("BaseTest.cpp")
|
||||
add_deps("ClientCore")
|
||||
add_deps("Protocol")
|
||||
add_deps("Util")
|
||||
add_frameworks("QtNetwork")
|
||||
@@ -1,17 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(Util LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
add_library(Util STATIC Util.h Util.cpp LocalFile.h LocalFile.cpp)
|
||||
target_link_libraries(Util PRIVATE Qt${QT_VERSION_MAJOR}::Core Struct)
|
||||
target_include_directories(Util PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
9
Util/xmake.lua
Normal file
9
Util/xmake.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("Util")
|
||||
add_rules("qt.static")
|
||||
add_includedirs(".", {public = true})
|
||||
add_files("*.cpp")
|
||||
add_files("*.h")
|
||||
add_deps("Protocol")
|
||||
add_frameworks("QtCore")
|
||||
@@ -1,38 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(crashelper LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
message(FATAL_ERROR "Unsupported MinGW Currently.")
|
||||
endif()
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
|
||||
set(CRASHELPER_SOURCES
|
||||
src/crashelper.cxx
|
||||
)
|
||||
|
||||
include_directories(include)
|
||||
add_library(crashelper STATIC ${CRASHELPER_SOURCES})
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_libraries(crashelper PUBLIC pthread dl bfd Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC -g)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
target_link_libraries(crashelper PUBLIC pthread dl bfd Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC -g)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_link_libraries(crashelper PRIVATE DbgHelp Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_compile_options(crashelper PUBLIC $<$<OR:$<STREQUAL:$<CXX_COMPILER_ID>,MSVC>,$<STREQUAL:$<C_COMPILER_ID>,MSVC>>:/Zi>)
|
||||
target_link_options(crashelper PUBLIC $<$<OR:$<STREQUAL:$<CXX_COMPILER_ID>,MSVC>,$<STREQUAL:$<C_COMPILER_ID>,MSVC>>:/DEBUG>)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}. This project only supports Linux, macOS, and Windows.")
|
||||
endif()
|
||||
#message(STATUS "crashelper:${CMAKE_CURRENT_LIST_DIR}")
|
||||
target_include_directories(crashelper PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
7
crashelper/xmake.lua
Normal file
7
crashelper/xmake.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("crashelper")
|
||||
add_rules("qt.static")
|
||||
add_includedirs("include", {public = true})
|
||||
add_files("src/*.cxx")
|
||||
add_frameworks("QtCore")
|
||||
17
version.h.in
17
version.h.in
@@ -1,9 +1,12 @@
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
#ifndef VERSION
|
||||
#define VERSION
|
||||
|
||||
#define VERSION_GIT_COMMIT "@VERSION_GIT_HASH@"
|
||||
#define VERSION_GIT_BRANCH "@VERSION_GIT_BRANCH@"
|
||||
#define VERSION_NUM "@PROJECT_VERSION@"
|
||||
#define VERSION_URL "@PROJECT_URL@"
|
||||
#define VERSION_MAJOR ${VERSION_MAJOR}
|
||||
#define VERSION_MINOR ${VERSION_MINOR}
|
||||
#define VERSION_ALTER ${VERSION_ALTER}
|
||||
#define VERSION_BUILD ${VERSION_BUILD}
|
||||
|
||||
#endif
|
||||
#define VERSION_GIT_COMMIT "${GIT_COMMIT}"
|
||||
#define VERSION_GIT_BRANCH "${GIT_BRANCH}"
|
||||
|
||||
#endif
|
||||
43
xmake.lua
Normal file
43
xmake.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
set_version("0.2.1", {build = "1"})
|
||||
|
||||
if is_plat("windows") then
|
||||
add_cxflags("/utf-8")
|
||||
end
|
||||
|
||||
if is_plat("mingw") then
|
||||
add_defines("NO_CRASHELPER=ON")
|
||||
end
|
||||
|
||||
if has_config("xp") then
|
||||
add_defines("_WIN32_WINNT=0x0501")
|
||||
else
|
||||
add_defines("_WIN32_WINNT=0x0601")
|
||||
end
|
||||
|
||||
add_defines("FMT_HEADER_ONLY")
|
||||
add_includedirs("3rd")
|
||||
|
||||
if has_config("gui") then
|
||||
includes("Gui", "3rd/SingleApplication-3.5.2")
|
||||
end
|
||||
|
||||
add_includedirs("$(builddir)")
|
||||
add_configfiles("version.h.in", {filename = "fversion.h", outputdir = "$(builddir)"})
|
||||
includes("Struct", "Protocol", "Util", "ClientCore", "Console", "Server", "Test")
|
||||
|
||||
if is_plat("mingw") then
|
||||
else
|
||||
includes("crashelper")
|
||||
end
|
||||
|
||||
option("xp")
|
||||
set_default(false)
|
||||
set_showmenu(true)
|
||||
set_description("Enable Windows XP support")
|
||||
|
||||
option("gui")
|
||||
set_default(false)
|
||||
set_showmenu(true)
|
||||
set_description("Enable GUI support")
|
||||
Reference in New Issue
Block a user