Travis-CI Patch for MacOS Build (#9)

Former-commit-id: 90e2ab14c2
This commit is contained in:
Leroy.H.Y 2019-06-23 23:39:18 -07:00 committed by GitHub
parent ada39fd0b0
commit eb059148da
2 changed files with 28 additions and 8 deletions

View File

@ -1,16 +1,25 @@
language: cpp
dist: xenial
compiler: g++
sudo: required
matrix:
include:
- os: linux
dist: xenial
sudo: required
env: BADGE=linux
- os: osx
env: BADGE=osx
before_install:
- sudo apt-get update
- if [ "$BADGE" = "linux" ]; then sudo apt-get update; fi
install:
- sudo apt-get install qtchooser qt5-default
- sudo apt-get install qt5-qmake
- sudo apt-get install qtdeclarative5-dev python3-dev python-dev libpython3-dev qttools5-dev-tools
- if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser qt5-default qt5-qmake qtdeclarative5-dev python3-dev python-dev libpython3-dev qttools5-dev-tools; fi
- if [ "$BADGE" = "osx" ]; then brew install cppcheck https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/qt.rb; fi
- if [ "$BADGE" = "osx" ]; then brew link --force qt; fi
before_script:
- if [ "$BADGE" = "osx" ]; then export PATH="/usr/local/opt/qt/bin:$PATH"; fi
script:
- lrelease ./Hv2ray.pro
- mkdir build && cd ./build

View File

@ -113,6 +113,17 @@ macx {
}
}
macx {
PYTHON_ROOT=/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions
exists( "$$PYTHON_ROOT/3.6/include/python3.6m/Python.h" ) {
equals(WITH_PYTHON, "no") {
message("Will build with python lib version 3.6.5_1.")
INCLUDEPATH += $$PYTHON_ROOT/3.6/include/python3.6m/
LIBS += -L$$PYTHON_ROOT/3.6/lib/python3.6/config-3.6m-darwin/ -lpython3.6m
WITH_PYTHON = yes
}
}
}
unix: equals(WITH_PYTHON, "no") {
error("No python libs found, did you install python3 dev package?")
}