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,6 +153,9 @@ message(" ")
RC_ICONS += ./assets/icons/qv2ray.ico RC_ICONS += ./assets/icons/qv2ray.ico
ICON = ./assets/icons/qv2ray.icns ICON = ./assets/icons/qv2ray.icns
contains( CONFIG, with_backend ) {
message("Compiling Qv2ray with custom backend")
} else {
# ------------------------------------------ Begin checking gRPC and protobuf headers. # ------------------------------------------ Begin checking gRPC and protobuf headers.
!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) { !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(" ") message(" ")
@ -168,6 +171,8 @@ ICON = ./assets/icons/qv2ray.icns
error("! ABORTING THE BUILD !") error("! ABORTING THE BUILD !")
message(" ") message(" ")
} }
}
# ------------------------------------------ Begin to detect language files. # ------------------------------------------ Begin to detect language files.
message("Looking for language support.") message("Looking for language support.")
@ -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")