Skip to content

Commit

Permalink
qmake: detect multi-arch build, sse4_1, enable openal for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Feb 28, 2016
1 parent 28324a2 commit 488569d
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 88 deletions.
4 changes: 2 additions & 2 deletions QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ contains(QT_CONFIG, opengl):!no-gl:!no-widgets {
}
}
## sse2 sse4_1 may be defined in Qt5 qmodule.pri but is not included. Qt4 defines sse and sse2
!ios:!no-sse4_1:!sse4_1: OptionalDepends *= sse4_1
!no-sse4_1:!sse4_1: OptionalDepends *= sse4_1
# no-xxx can set in $$PWD/user.conf
!no-openal: OptionalDepends *= openal
!no-openal:!mac:!ios: OptionalDepends *= openal #FIXME: ios openal header not found in qtCompileTest but fine if manually make
!no-libass: OptionalDepends *= libass
!no-uchardet: OptionalDepends *= uchardet
win32:macx:!android:!winrt:!no-portaudio: OptionalDepends *= portaudio
Expand Down
6 changes: 3 additions & 3 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ defineReplace(qtSharedLib) {
}

defineReplace(qtLongName) {
unset(LONG_NAME)
LONG_NAME = $$1$${_OS}_$${TARGET_ARCH}$${_EXTRA}
return($$LONG_NAME)
unset(LONG_NAME)
LONG_NAME = $$1$${_OS}_$$join(TARGET_ARCH,+)$${_EXTRA}
return($$LONG_NAME)
}

defineTest(empty_file) {
Expand Down
3 changes: 2 additions & 1 deletion configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ defineTest(qtCompileTest) {
}
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""

iphoneos: qmake_configs += "\"CONFIG+=iphoneos\""
iphonesimulator: qmake_configs += "\"CONFIG+=iphonesimulator\""
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")

Expand Down
4 changes: 2 additions & 2 deletions root.pri
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ greaterThan(QT_MAJOR_VERSION, 4):contains(SUPPORTED_MAKEFILE_GENERATOR, $$MAKEFI
#workaround for android on windows. I don't know how qt deal with it
equals(MAKEFILE_GENERATOR, UNIX):equals(QMAKE_HOST.os, Windows):MAKEFILE_GENERATOR=MINGW
#configure.prf error if makefile generator is not supported and no display in qtcreator
load(configure)
load(configure) #FIXME: ios can not set CONFIG+=iphoneos
} else {
#recheck:write_file($$BUILD_DIR/.qmake.cache) #FIXME: empty_file result in no qtCompileTest result in cache
#use the following lines when building as a sub-project, write cache to this project src dir.
Expand Down Expand Up @@ -80,9 +80,9 @@ defineTest(testArch) {
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunCommandQuitly("$$test_cmd_base $$QMAKE_MAKE distclean")

#message("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$system_path($$test_dir)")
SPEC =
!isEmpty(QMAKESPEC): SPEC = "-spec $$QMAKESPEC"
#message("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)")
qtRunCommandQuitly("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)") {
MSG=$$system("$$test_cmd_base $$QMAKE_MAKE 2>&1")
}
Expand Down
7 changes: 4 additions & 3 deletions src/libQtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RESOURCES += QtAV.qrc \
RC_ICONS = QtAV.ico
QMAKE_TARGET_COMPANY = "Shanghai University->S3 Graphics->Deepin | [email protected]"
QMAKE_TARGET_DESCRIPTION = "QtAV Multimedia framework. http://qtav.org"
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2012-2015 WangBin, [email protected]"
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2012-2016 WangBin, [email protected]"
QMAKE_TARGET_PRODUCT = "QtAV"
} else:win32 {
RC_FILE = QtAV.rc
Expand Down Expand Up @@ -101,7 +101,7 @@ win32-msvc2010|win32-msvc2008: QMAKE_LFLAGS *= /DEBUG #workaround for CoInitiali
#UINT64_C: C99 math features, need -D__STDC_CONSTANT_MACROS in CXXFLAGS
DEFINES += __STDC_CONSTANT_MACROS
android {
CONFIG += config_opensl
CONFIG *= config_opensl
!no_gui_private:qtHaveModule(androidextras) { #qt5.2 has QAndroidJniObject
QT *= androidextras gui-private #QPlatformNativeInterface get "QtActivity"
SOURCES *= io/AndroidIO.cpp
Expand Down Expand Up @@ -162,6 +162,7 @@ config_ipp {
#omp for static link. _t is multi-thread static link
}
mac|ios {
CONFIG *= config_openal
SOURCES += output/audio/AudioOutputAudioToolbox.cpp
LIBS += -framework AudioToolbox
}
Expand Down Expand Up @@ -242,7 +243,7 @@ include(../depends/dllapi/src/libdllapi.pri)
DEFINES += CUDA_LINK
INCLUDEPATH += $$(CUDA_PATH)/include
LIBS += -L$$(CUDA_PATH)/lib
isEqual(TARGET_ARCH, x86): LIBS += -L$$(CUDA_PATH)/lib/Win32
contains(TARGET_ARCH, x86): LIBS += -L$$(CUDA_PATH)/lib/Win32
else: LIBS += -L$$(CUDA_PATH)/lib/x64
LIBS += -lnvcuvid -lcuda
}
Expand Down
162 changes: 85 additions & 77 deletions tests/arch/arch.cpp
Original file line number Diff line number Diff line change
@@ -1,110 +1,118 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2012 Intel Corporation
** Contact: http://www.qt-project.org/legal
**
** This file is part of the FOO module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
// change from qtbase/config.tests/arch/arch.cpp

#define QGLOBAL_H
#include "qprocessordetection.h"

/* vc: arm, mips, sh, x86, x86_64, ia64*/
#if defined(Q_PROCESSOR_ALPHA)
#warning "ARCH=alpha"
#elif defined(Q_PROCESSOR_ARM_32)
#warning "ARCH*=alpha"
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_ARM_32)
#ifdef _MSC_VER
#pragma message ("ARCH=arm")
#pragma message ("ARCH*=arm")
#else
#warning "ARCH=arm"
#warning "ARCH*=arm"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_ARM_64)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_ARM_64)
#ifdef _MSC_VER
#pragma message ("ARCH=arm64")
#pragma message ("ARCH*=arm64")
#else
#warning "ARCH=arm64"
#warning "ARCH*=arm64"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_ARM)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_ARM)
#ifdef _MSC_VER
#pragma message ("ARCH=arm")
#pragma message ("ARCH*=arm")
#else
#warning "ARCH=arm"
#warning "ARCH*=arm"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_AVR32)
#warning "ARCH=avr32"
#elif defined(Q_PROCESSOR_BLACKFIN)
#warning "ARCH=bfin"
#elif defined(Q_PROCESSOR_X86_32)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_AVR32)
#warning "ARCH*=avr32"
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_BLACKFIN)
#warning "ARCH*=bfin"
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_X86_32)
#ifdef _MSC_VER
#pragma message ("ARCH=x86")
#pragma message ("ARCH*=x86")
#else
#warning "ARCH=x86"
#warning "ARCH*=x86"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_X86_64)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_X86_64)
#ifdef _MSC_VER
#pragma message ("ARCH=x86_64")
#pragma message ("ARCH*=x86_64")
#else
#warning "ARCH=x86_64"
#warning "ARCH*=x86_64"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_IA64)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_IA64)
#ifdef _MSC_VER
#pragma message ("ARCH=ia64")
#pragma message ("ARCH*=ia64")
#else
#warning "ARCH=ia64"
#warning "ARCH*=ia64"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_MIPS)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_MIPS)
#ifdef _MSC_VER
#pragma message ("ARCH=mips")
#pragma message ("ARCH*=mips")
#else
#warning "ARCH=mips"
#warning "ARCH*=mips"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_POWER)
#warning "ARCH=power"
#elif defined(Q_PROCESSOR_S390)
#warning "ARCH=s390"
#elif defined(Q_PROCESSOR_SH)
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_POWER)
#warning "ARCH*=power"
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_S390)
#warning "ARCH*=s390"
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_SH)
#ifdef _MSC_VER
#pragma message ("ARCH=sh")
#pragma message ("ARCH*=sh")
#else
#warning "ARCH=sh"
#warning "ARCH*=sh"
#endif /*_MSC_VER*/
#elif defined(Q_PROCESSOR_SPARC)
#warning "ARCH=sparc"
#else
#define ARCH_DETECTED
#endif
#if defined(Q_PROCESSOR_SPARC)
#warning "ARCH*=sparc"
#define ARCH_DETECTED
#endif
#ifndef ARCH_DETECTED
#warning "ARCH=unknown"
#endif

Expand Down

0 comments on commit 488569d

Please sign in to comment.