Skip to content

Commit 488569d

Browse files
committed
qmake: detect multi-arch build, sse4_1, enable openal for ios
1 parent 28324a2 commit 488569d

File tree

6 files changed

+98
-88
lines changed

6 files changed

+98
-88
lines changed

QtAV.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ contains(QT_CONFIG, opengl):!no-gl:!no-widgets {
4848
}
4949
}
5050
## sse2 sse4_1 may be defined in Qt5 qmodule.pri but is not included. Qt4 defines sse and sse2
51-
!ios:!no-sse4_1:!sse4_1: OptionalDepends *= sse4_1
51+
!no-sse4_1:!sse4_1: OptionalDepends *= sse4_1
5252
# no-xxx can set in $$PWD/user.conf
53-
!no-openal: OptionalDepends *= openal
53+
!no-openal:!mac:!ios: OptionalDepends *= openal #FIXME: ios openal header not found in qtCompileTest but fine if manually make
5454
!no-libass: OptionalDepends *= libass
5555
!no-uchardet: OptionalDepends *= uchardet
5656
win32:macx:!android:!winrt:!no-portaudio: OptionalDepends *= portaudio

common.pri

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ defineReplace(qtSharedLib) {
176176
}
177177

178178
defineReplace(qtLongName) {
179-
unset(LONG_NAME)
180-
LONG_NAME = $$1$${_OS}_$${TARGET_ARCH}$${_EXTRA}
181-
return($$LONG_NAME)
179+
unset(LONG_NAME)
180+
LONG_NAME = $$1$${_OS}_$$join(TARGET_ARCH,+)$${_EXTRA}
181+
return($$LONG_NAME)
182182
}
183183

184184
defineTest(empty_file) {

configure.pri

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ defineTest(qtCompileTest) {
112112
}
113113
# Disable qmake features which are typically counterproductive for tests
114114
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
115-
115+
iphoneos: qmake_configs += "\"CONFIG+=iphoneos\""
116+
iphonesimulator: qmake_configs += "\"CONFIG+=iphonesimulator\""
116117
# Clean up after previous run
117118
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
118119

root.pri

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

83-
#message("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$system_path($$test_dir)")
8483
SPEC =
8584
!isEmpty(QMAKESPEC): SPEC = "-spec $$QMAKESPEC"
85+
#message("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)")
8686
qtRunCommandQuitly("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)") {
8787
MSG=$$system("$$test_cmd_base $$QMAKE_MAKE 2>&1")
8888
}

src/libQtAV.pro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RESOURCES += QtAV.qrc \
5959
RC_ICONS = QtAV.ico
6060
QMAKE_TARGET_COMPANY = "Shanghai University->S3 Graphics->Deepin | [email protected]"
6161
QMAKE_TARGET_DESCRIPTION = "QtAV Multimedia framework. http://qtav.org"
62-
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2012-2015 WangBin, [email protected]"
62+
QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2012-2016 WangBin, [email protected]"
6363
QMAKE_TARGET_PRODUCT = "QtAV"
6464
} else:win32 {
6565
RC_FILE = QtAV.rc
@@ -101,7 +101,7 @@ win32-msvc2010|win32-msvc2008: QMAKE_LFLAGS *= /DEBUG #workaround for CoInitiali
101101
#UINT64_C: C99 math features, need -D__STDC_CONSTANT_MACROS in CXXFLAGS
102102
DEFINES += __STDC_CONSTANT_MACROS
103103
android {
104-
CONFIG += config_opensl
104+
CONFIG *= config_opensl
105105
!no_gui_private:qtHaveModule(androidextras) { #qt5.2 has QAndroidJniObject
106106
QT *= androidextras gui-private #QPlatformNativeInterface get "QtActivity"
107107
SOURCES *= io/AndroidIO.cpp
@@ -162,6 +162,7 @@ config_ipp {
162162
#omp for static link. _t is multi-thread static link
163163
}
164164
mac|ios {
165+
CONFIG *= config_openal
165166
SOURCES += output/audio/AudioOutputAudioToolbox.cpp
166167
LIBS += -framework AudioToolbox
167168
}
@@ -242,7 +243,7 @@ include(../depends/dllapi/src/libdllapi.pri)
242243
DEFINES += CUDA_LINK
243244
INCLUDEPATH += $$(CUDA_PATH)/include
244245
LIBS += -L$$(CUDA_PATH)/lib
245-
isEqual(TARGET_ARCH, x86): LIBS += -L$$(CUDA_PATH)/lib/Win32
246+
contains(TARGET_ARCH, x86): LIBS += -L$$(CUDA_PATH)/lib/Win32
246247
else: LIBS += -L$$(CUDA_PATH)/lib/x64
247248
LIBS += -lnvcuvid -lcuda
248249
}

tests/arch/arch.cpp

Lines changed: 85 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,118 @@
1-
/****************************************************************************
2-
**
3-
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4-
** Copyright (C) 2012 Intel Corporation
5-
** Contact: http://www.qt-project.org/legal
6-
**
7-
** This file is part of the FOO module of the Qt Toolkit.
8-
**
9-
** $QT_BEGIN_LICENSE:LGPL$
10-
** Commercial License Usage
11-
** Licensees holding valid commercial Qt licenses may use this file in
12-
** accordance with the commercial license agreement provided with the
13-
** Software or, alternatively, in accordance with the terms contained in
14-
** a written agreement between you and Digia. For licensing terms and
15-
** conditions see http://qt.digia.com/licensing. For further information
16-
** use the contact form at http://qt.digia.com/contact-us.
17-
**
18-
** GNU Lesser General Public License Usage
19-
** Alternatively, this file may be used under the terms of the GNU Lesser
20-
** General Public License version 2.1 as published by the Free Software
21-
** Foundation and appearing in the file LICENSE.LGPL included in the
22-
** packaging of this file. Please review the following information to
23-
** ensure the GNU Lesser General Public License version 2.1 requirements
24-
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25-
**
26-
** In addition, as a special exception, Digia gives you certain additional
27-
** rights. These rights are described in the Digia Qt LGPL Exception
28-
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29-
**
30-
** GNU General Public License Usage
31-
** Alternatively, this file may be used under the terms of the GNU
32-
** General Public License version 3.0 as published by the Free Software
33-
** Foundation and appearing in the file LICENSE.GPL included in the
34-
** packaging of this file. Please review the following information to
35-
** ensure the GNU General Public License version 3.0 requirements will be
36-
** met: http://www.gnu.org/copyleft/gpl.html.
37-
**
38-
**
39-
** $QT_END_LICENSE$
40-
**
41-
****************************************************************************/
1+
/******************************************************************************
2+
QtAV: Media play library based on Qt and FFmpeg
3+
Copyright (C) 2012-2016 Wang Bin <[email protected]>
4+
5+
* This file is part of QtAV
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public
18+
License along with this library; if not, write to the Free Software
19+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
******************************************************************************/
21+
// change from qtbase/config.tests/arch/arch.cpp
4222

4323
#define QGLOBAL_H
4424
#include "qprocessordetection.h"
4525

4626
/* vc: arm, mips, sh, x86, x86_64, ia64*/
4727
#if defined(Q_PROCESSOR_ALPHA)
48-
#warning "ARCH=alpha"
49-
#elif defined(Q_PROCESSOR_ARM_32)
28+
#warning "ARCH*=alpha"
29+
#define ARCH_DETECTED
30+
#endif
31+
#if defined(Q_PROCESSOR_ARM_32)
5032
#ifdef _MSC_VER
51-
#pragma message ("ARCH=arm")
33+
#pragma message ("ARCH*=arm")
5234
#else
53-
#warning "ARCH=arm"
35+
#warning "ARCH*=arm"
5436
#endif /*_MSC_VER*/
55-
#elif defined(Q_PROCESSOR_ARM_64)
37+
#define ARCH_DETECTED
38+
#endif
39+
#if defined(Q_PROCESSOR_ARM_64)
5640
#ifdef _MSC_VER
57-
#pragma message ("ARCH=arm64")
41+
#pragma message ("ARCH*=arm64")
5842
#else
59-
#warning "ARCH=arm64"
43+
#warning "ARCH*=arm64"
6044
#endif /*_MSC_VER*/
61-
#elif defined(Q_PROCESSOR_ARM)
45+
#define ARCH_DETECTED
46+
#endif
47+
#if defined(Q_PROCESSOR_ARM)
6248
#ifdef _MSC_VER
63-
#pragma message ("ARCH=arm")
49+
#pragma message ("ARCH*=arm")
6450
#else
65-
#warning "ARCH=arm"
51+
#warning "ARCH*=arm"
6652
#endif /*_MSC_VER*/
67-
#elif defined(Q_PROCESSOR_AVR32)
68-
#warning "ARCH=avr32"
69-
#elif defined(Q_PROCESSOR_BLACKFIN)
70-
#warning "ARCH=bfin"
71-
#elif defined(Q_PROCESSOR_X86_32)
53+
#define ARCH_DETECTED
54+
#endif
55+
#if defined(Q_PROCESSOR_AVR32)
56+
#warning "ARCH*=avr32"
57+
#define ARCH_DETECTED
58+
#endif
59+
#if defined(Q_PROCESSOR_BLACKFIN)
60+
#warning "ARCH*=bfin"
61+
#define ARCH_DETECTED
62+
#endif
63+
#if defined(Q_PROCESSOR_X86_32)
7264
#ifdef _MSC_VER
73-
#pragma message ("ARCH=x86")
65+
#pragma message ("ARCH*=x86")
7466
#else
75-
#warning "ARCH=x86"
67+
#warning "ARCH*=x86"
7668
#endif /*_MSC_VER*/
77-
#elif defined(Q_PROCESSOR_X86_64)
69+
#define ARCH_DETECTED
70+
#endif
71+
#if defined(Q_PROCESSOR_X86_64)
7872
#ifdef _MSC_VER
79-
#pragma message ("ARCH=x86_64")
73+
#pragma message ("ARCH*=x86_64")
8074
#else
81-
#warning "ARCH=x86_64"
75+
#warning "ARCH*=x86_64"
8276
#endif /*_MSC_VER*/
83-
#elif defined(Q_PROCESSOR_IA64)
77+
#define ARCH_DETECTED
78+
#endif
79+
#if defined(Q_PROCESSOR_IA64)
8480
#ifdef _MSC_VER
85-
#pragma message ("ARCH=ia64")
81+
#pragma message ("ARCH*=ia64")
8682
#else
87-
#warning "ARCH=ia64"
83+
#warning "ARCH*=ia64"
8884
#endif /*_MSC_VER*/
89-
#elif defined(Q_PROCESSOR_MIPS)
85+
#define ARCH_DETECTED
86+
#endif
87+
#if defined(Q_PROCESSOR_MIPS)
9088
#ifdef _MSC_VER
91-
#pragma message ("ARCH=mips")
89+
#pragma message ("ARCH*=mips")
9290
#else
93-
#warning "ARCH=mips"
91+
#warning "ARCH*=mips"
9492
#endif /*_MSC_VER*/
95-
#elif defined(Q_PROCESSOR_POWER)
96-
#warning "ARCH=power"
97-
#elif defined(Q_PROCESSOR_S390)
98-
#warning "ARCH=s390"
99-
#elif defined(Q_PROCESSOR_SH)
93+
#define ARCH_DETECTED
94+
#endif
95+
#if defined(Q_PROCESSOR_POWER)
96+
#warning "ARCH*=power"
97+
#define ARCH_DETECTED
98+
#endif
99+
#if defined(Q_PROCESSOR_S390)
100+
#warning "ARCH*=s390"
101+
#define ARCH_DETECTED
102+
#endif
103+
#if defined(Q_PROCESSOR_SH)
100104
#ifdef _MSC_VER
101-
#pragma message ("ARCH=sh")
105+
#pragma message ("ARCH*=sh")
102106
#else
103-
#warning "ARCH=sh"
107+
#warning "ARCH*=sh"
104108
#endif /*_MSC_VER*/
105-
#elif defined(Q_PROCESSOR_SPARC)
106-
#warning "ARCH=sparc"
107-
#else
109+
#define ARCH_DETECTED
110+
#endif
111+
#if defined(Q_PROCESSOR_SPARC)
112+
#warning "ARCH*=sparc"
113+
#define ARCH_DETECTED
114+
#endif
115+
#ifndef ARCH_DETECTED
108116
#warning "ARCH=unknown"
109117
#endif
110118

0 commit comments

Comments
 (0)