Travis + qb fixes. (#8040)

* travis: Enable building qt for linux.

* qb: Set QT_SELECT for moc and qtchooser.

This should have no effect on systems where qtchooser is not used.

Fixes https://github.com/libretro/RetroArch/issues/8028

* qb: Actually disable c++ features if there is no c++ compiler.

Now this warning actually does something.

  Warning: A working C++ compiler was not found, C++ features will be disabled.
This commit is contained in:
orbea 2019-01-19 08:21:31 -08:00 committed by bparker06
parent 71f24f067b
commit 9c7affc2cf
5 changed files with 36 additions and 35 deletions

View File

@ -24,23 +24,16 @@ matrix:
- make
env: CROSS_COMPILE=x86_64-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501"
- compiler: gcc
addons:
# Install a more recent gcc than the default
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
# Install a more recent gcc than the default
before_install:
- sudo apt-get install -y g++-8
env: CC=gcc-8 CXX=g++-8
- compiler: clang
addons:
# Install a more recent clang than the default
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env: COMPILER_NAME=clang-3.8 CXX=clang++-3.8 CC=clang-3.8
# Install a more recent clang than the default
before_install:
- sudo apt-get install -y libstdc++-7-dev
- sudo apt-get install -y clang-6.0
env: CC=clang-6.0 CXX=clang++-6.0
- os: osx
osx_image: xcode8
script:
@ -69,19 +62,13 @@ env:
addons:
apt:
packages:
- curl
- pkg-config
- libglu1-mesa-dev
- freeglut3-dev
- mesa-common-dev
- libsdl1.2-dev
- libsdl-image1.2-dev
- libsdl-mixer1.2-dev
- libsdl-ttf2.0-dev
- libsdl2-dev
- libusb-1.0-0-dev
- qt5-default
- qt5-qmake
- qtbase5-dev-tools
- qtbase5-dev
- qtdeclarative5-dev
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
coverity_scan:
project:
name: "RetroArch"

View File

@ -171,7 +171,7 @@ all: $(TARGET) config.mk
$(MOC_SRC):
@$(if $(Q), $(shell echo echo MOC $<),)
$(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@))
$(Q)$(MOC) -o $(MOC_TMP) $<
$(Q)QT_SELECT=$(QT_VERSION) $(MOC) -o $(MOC_TMP) $<
$(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x))

View File

@ -184,6 +184,12 @@ else
check_lib '' DYLIB "$DYLIB" dlopen
fi
if [ "$HAVE_CXX" != 'yes' ]; then
HAVE_DISCORD='no'
HAVE_QT='no'
HAVE_VULKAN='no'
fi
check_lib '' NETWORKING "$SOCKETLIB" socket "" "$SOCKETHEADER"
if [ "$HAVE_NETWORKING" = 'yes' ]; then
@ -277,14 +283,13 @@ check_val '' SDL2 -lSDL2 SDL2
check_enabled QT 'Qt companion'
if [ "$HAVE_QT" != 'no' ] && [ "$HAVE_CXX" != "no" ]; then
if [ "$HAVE_QT" != 'no' ]; then
check_pkgconf QT5CORE Qt5Core 5.2
check_pkgconf QT5GUI Qt5Gui 5.2
check_pkgconf QT5WIDGETS Qt5Widgets 5.2
check_pkgconf QT5CONCURRENT Qt5Concurrent 5.2
check_pkgconf QT5NETWORK Qt5Network 5.2
#check_pkgconf QT5WEBENGINE Qt5WebEngine 5.4
check_pkgconf OPENSSL openssl 1.0.0
# pkg-config is needed to reliably find Qt5 libraries.
@ -295,6 +300,8 @@ if [ "$HAVE_QT" != 'no' ] && [ "$HAVE_CXX" != "no" ]; then
HAVE_QT=yes
fi
check_pkgconf OPENSSL openssl 1.0.0
#if [ "$HAVE_QT5WEBENGINE" = "no" ]; then
# die : 'Notice: Qt5WebEngine not found, disabling web browser support.'
#fi

4
qb/config.moc.sh Normal file
View File

@ -0,0 +1,4 @@
QT_VERSION=qt5
QT_FLAGS="$QT5CORE_CFLAGS $QT5CORE_LIBS"
add_define MAKEFILE QT_VERSION "$QT_VERSION"

View File

@ -1,3 +1,5 @@
. qb/config.moc.sh
TEMP_MOC=.moc.h
TEMP_CPP=.moc.cpp
@ -16,18 +18,19 @@ HAVE_MOC=no
if [ "$HAVE_QT" = "yes" ]; then
moc_works=0
if [ "$MOC" ]; then
QT_SELECT="$QT_VERSION" \
"$MOC" -o "$TEMP_CPP" "$TEMP_MOC" >/dev/null 2>&1 &&
"$CXX" -o "$TEMP_EXE" $(printf %s "$QT5CORE_CFLAGS $QT5CORE_LIBS") \
"$CXX" -o "$TEMP_EXE" $(printf %s "$QT_FLAGS") \
-fPIC -c "$TEMP_CPP" >/dev/null 2>&1 &&
moc_works=1
else
for moc in moc-qt5 moc; do
for moc in "moc-$QT_VERSION" moc; do
MOC="$(exists "$moc")" || MOC=""
if [ "$MOC" ]; then
QT_SELECT="$QT_VERSION" \
"$MOC" -o "$TEMP_CPP" "$TEMP_MOC" >/dev/null 2>&1 ||
continue
"$CXX" -o "$TEMP_EXE" \
$(printf %s "$QT5CORE_CFLAGS $QT5CORE_LIBS") \
"$CXX" -o "$TEMP_EXE" $(printf %s "$QT_FLAGS") \
-fPIC -c "$TEMP_CPP" >/dev/null 2>&1 && {
moc_works=1
break