diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-12-06 16:55:57 -0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2018-12-20 00:55:36 +0000 |
commit | b725e6de4549221b191174bcbfc78fd57c4638e8 (patch) | |
tree | 01cfd33c47ea80f2d9b18a8290818b06bebed3e0 /recipes-qt/qt5 | |
parent | 7016481c80f79e2985a87e0188ce8110568256a8 (diff) | |
download | meta-qt5-b725e6de4549221b191174bcbfc78fd57c4638e8.tar.gz |
qtbase: Consider clang when computing QMAKE_CXX.COMPILER_MACROS
Helps in compiling qtapps with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5')
-rw-r--r-- | recipes-qt/qt5/nativesdk-qtbase_git.bb | 1 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase-native_git.bb | 1 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase/0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch | 41 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 1 |
4 files changed, 44 insertions, 0 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb index 77594b0b..760eb7ca 100644 --- a/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb | |||
@@ -43,6 +43,7 @@ SRC_URI += "\ | |||
43 | file://0016-Disable-ltcg-for-host_build.patch \ | 43 | file://0016-Disable-ltcg-for-host_build.patch \ |
44 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 44 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
45 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ | 45 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ |
46 | file://0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | ||
46 | " | 47 | " |
47 | 48 | ||
48 | # common for qtbase-native and nativesdk-qtbase | 49 | # common for qtbase-native and nativesdk-qtbase |
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb index 4c26d0f3..31c10ff6 100644 --- a/recipes-qt/qt5/qtbase-native_git.bb +++ b/recipes-qt/qt5/qtbase-native_git.bb | |||
@@ -38,6 +38,7 @@ SRC_URI += "\ | |||
38 | file://0016-Disable-ltcg-for-host_build.patch \ | 38 | file://0016-Disable-ltcg-for-host_build.patch \ |
39 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 39 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
40 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ | 40 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ |
41 | file://0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | ||
41 | " | 42 | " |
42 | 43 | ||
43 | # common for qtbase-native and nativesdk-qtbase | 44 | # common for qtbase-native and nativesdk-qtbase |
diff --git a/recipes-qt/qt5/qtbase/0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch b/recipes-qt/qt5/qtbase/0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch new file mode 100644 index 00000000..01ef5b88 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 7248a700e9c4ed1df41dbfcfebcd32bb6951bd36 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 6 Dec 2018 15:06:20 -0800 | ||
4 | Subject: [PATCH] Define QMAKE_CXX.COMPILER_MACROS for clang on linux | ||
5 | |||
6 | This is required when using clang for compiler, fixes | ||
7 | mkspecs/features/toolchain.prf:215: Variable QMAKE_CXX.COMPILER_MACROS is not defined. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | mkspecs/features/toolchain.prf | 11 ++++++++++- | ||
13 | 1 file changed, 10 insertions(+), 1 deletion(-) | ||
14 | |||
15 | Index: git/mkspecs/features/toolchain.prf | ||
16 | =================================================================== | ||
17 | --- git.orig/mkspecs/features/toolchain.prf | ||
18 | +++ git/mkspecs/features/toolchain.prf | ||
19 | @@ -180,6 +180,13 @@ defineReplace(qtVariablesFromGCC) { | ||
20 | return($$ret) | ||
21 | } | ||
22 | |||
23 | +defineReplace(qtVariablesFromCLANG) { | ||
24 | + ret = $$system("$$1 $$2 -E $$system_quote($$PWD/data/macros.cpp) \ | ||
25 | + <$$QMAKE_SYSTEM_NULL_DEVICE 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) | ||
26 | + !equals(ec, 0): qtCompilerErrror($$1, $$ret) | ||
27 | + return($$ret) | ||
28 | +} | ||
29 | + | ||
30 | isEmpty($${target_prefix}.COMPILER_MACROS) { | ||
31 | msvc { | ||
32 | clang_cl { | ||
33 | @@ -199,6 +206,8 @@ isEmpty($${target_prefix}.COMPILER_MACRO | ||
34 | } else { | ||
35 | vars = $$qtVariablesFromMSVC($$QMAKE_CXX) | ||
36 | } | ||
37 | + } else: clang { | ||
38 | + vars = $$qtVariablesFromCLANG($$QMAKE_CXX, $$QMAKE_CXXFLAGS) | ||
39 | } else: gcc { | ||
40 | vars = $$qtVariablesFromGCC($$QMAKE_CXX) | ||
41 | } | ||
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index 57fa1783..e50c90f5 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -34,6 +34,7 @@ SRC_URI += "\ | |||
34 | file://0016-Disable-ltcg-for-host_build.patch \ | 34 | file://0016-Disable-ltcg-for-host_build.patch \ |
35 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ | 35 | file://0017-Qt5GuiConfigExtras.cmake.in-cope-with-variable-path-.patch \ |
36 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ | 36 | file://0020-corelib-Include-sys-types.h-for-uint32_t.patch \ |
37 | file://0021-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ | ||
37 | " | 38 | " |
38 | 39 | ||
39 | 40 | ||