Add build parameter for homemade backend

This commit is contained in:
Guobang Bi 2020-01-22 19:01:46 +08:00
parent 2f4f70a165
commit c8e47c304a
No known key found for this signature in database
GPG Key ID: D850BE43BE29325B
2 changed files with 35 additions and 20 deletions

View File

@ -138,7 +138,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
qmake .. CONFIG+=no_increase_build_number PREFIX=/usr qmake .. CONFIG+=no_increase_build_number PREFIX=/usr with_backend
- name: Building Qv2ray - name: Building Qv2ray
run: | run: |
cd build cd build

View File

@ -153,22 +153,27 @@ message(" ")
RC_ICONS += ./assets/icons/qv2ray.ico RC_ICONS += ./assets/icons/qv2ray.ico
ICON = ./assets/icons/qv2ray.icns ICON = ./assets/icons/qv2ray.icns
# ------------------------------------------ Begin checking gRPC and protobuf headers. contains( CONFIG, with_backend ) {
!exists(libs/gen/v2ray_api_commands.grpc.pb.h) || !exists(libs/gen/v2ray_api_commands.grpc.pb.cc) || !exists(libs/gen/v2ray_api_commands.pb.h) || !exists(libs/gen/v2ray_api_commands.pb.cc) { message("Compiling Qv2ray with custom backend")
message(" ") } else {
message("-----------------------------------------------") # ------------------------------------------ Begin checking gRPC and protobuf headers.
message("Cannot continue: ") !exists(libs/gen/v2ray_api_commands.grpc.pb.h) || !exists(libs/gen/v2ray_api_commands.grpc.pb.cc) || !exists(libs/gen/v2ray_api_commands.pb.h) || !exists(libs/gen/v2ray_api_commands.pb.cc) {
message(" --> Qv2ray is not properly configured yet: ") message(" ")
message(" gRPC and protobuf headers for v2ray API is missing.") message("-----------------------------------------------")
message(" --> Please run gen_grpc.sh gen_grpc.bat or deps_macOS.sh located in tools/") message("Cannot continue: ")
message(" --> Or consider reading the build wiki: https://github.com/lhy0403/Qv2ray/wiki/Manually-Build-Qv2ray") message(" --> Qv2ray is not properly configured yet: ")
message("-----------------------------------------------") message(" gRPC and protobuf headers for v2ray API is missing.")
message(" ") message(" --> Please run gen_grpc.sh gen_grpc.bat or deps_macOS.sh located in tools/")
warning("IF YOU THINK IT'S A MISTAKE, PLEASE OPEN AN ISSUE") message(" --> Or consider reading the build wiki: https://github.com/lhy0403/Qv2ray/wiki/Manually-Build-Qv2ray")
error("! ABORTING THE BUILD !") message("-----------------------------------------------")
message(" ") message(" ")
warning("IF YOU THINK IT'S A MISTAKE, PLEASE OPEN AN ISSUE")
error("! ABORTING THE BUILD !")
message(" ")
}
} }
# ------------------------------------------ Begin to detect language files. # ------------------------------------------ Begin to detect language files.
message("Looking for language support.") message("Looking for language support.")
QM_FILES_RESOURCE_PREFIX = "translations" QM_FILES_RESOURCE_PREFIX = "translations"
@ -245,9 +250,6 @@ macx {
message(" --> Linking libgpr and libupb.") message(" --> Linking libgpr and libupb.")
LIBS += -lgpr -lupb LIBS += -lgpr -lupb
message(" --> Linking libqvb static library.")
LIBS += -L$$PWD/libs/ -lqvb-darwin
} }
# Reuse unix for macx as well # Reuse unix for macx as well
@ -258,8 +260,6 @@ unix {
message(" --> Linking against gRPC and protobuf library.") message(" --> Linking against gRPC and protobuf library.")
LIBS += -L/usr/local/lib -lgrpc++ -lprotobuf -lgrpc LIBS += -L/usr/local/lib -lgrpc++ -lprotobuf -lgrpc
message(" --> Linking libqvb static library.")
unix:!macx: LIBS += -L$$PWD/libs/ -lqvb-linux64
# macOS homebrew include path # macOS homebrew include path
message(" --> Adding local include folder to search path") message(" --> Adding local include folder to search path")
@ -288,6 +288,21 @@ with_metainfo {
INSTALLS += appdataXml INSTALLS += appdataXml
} }
with_backend {
message(" --> Unlinking gRPC and protobuf library.")
LIBS -= -lgrpc++ -lprotobuf -lgrpc
linux-g++ {
message(" --> Linking libqvb static library.")
LIBS += -L$$PWD/libs/ -lqvb-linux64
}
macx-g++ {
message(" --> Linking libqvb static library.")
LIBS += -L$$PWD/libs/ -lqvb-darwin
}
}
message(" ") message(" ")
message("Done configuring Qv2ray project. Build output will be at:" $$OUT_PWD) message("Done configuring Qv2ray project. Build output will be at:" $$OUT_PWD)
message("Type `make` or `mingw32-make` to start building Qv2ray") message("Type `make` or `mingw32-make` to start building Qv2ray")