summaryrefslogtreecommitdiffstats
path: root/patches/qt-everywhere-opensource-src-5.6.0/0001-Disable-c-standard-compiler-flags-for-the-host-build.patch
blob: 4b7b0c757bea5a6b14a8d0bef357075ae8cc8db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Peter Seiderer <ps.report@gmx.net>
Date: Thu, 3 Mar 2016 15:17:31 +0100
Subject: [PATCH] Disable c++ standard compiler flags for the host build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There is no test for c++ standard support for the host build
(only for the target compiler/build) which leads to trouble
in some cross compiling environments (old host compiler, new
cross compiler):

  g++: error: unrecognized command line option ‘-std=c++1z’

So disable c++ standard compiler flags unconditionally for host builds.

Task-number: QTBUG-51644
Change-Id: Ifb3042e125fe199a7e081740d1171d26ccacf0c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
---
 qtbase/mkspecs/features/default_post.prf | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/qtbase/mkspecs/features/default_post.prf b/qtbase/mkspecs/features/default_post.prf
index cd8d8859aa91..561c8f4858cc 100644
--- a/qtbase/mkspecs/features/default_post.prf
+++ b/qtbase/mkspecs/features/default_post.prf
@@ -95,7 +95,10 @@ breakpad {
     !isEmpty(QMAKE_STRIP):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)$$quote($$QMAKE_STRIP $$DEBUGFILENAME)
 }
 
-c++11|c++14|c++1z {
+# Disable special compiler flags for host builds (needs to be changed for 5.7
+# to fall back to c++11 because since 5.7 c++11 is required everywhere,
+# including host builds).
+if(!host_build|!cross_compile):if(c++11|c++14|c++1z) {
     c++1z:       cxxstd = CXX1Z
     else: c++14: cxxstd = CXX14
     else:        cxxstd = CXX11