diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-14 12:36:41 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-14 11:47:12 +0000 |
commit | ec6da06e18f90778080f4b59df503789e8165120 (patch) | |
tree | f6de9e08c1281590618d10e2056adeaef62a0924 /sources | |
parent | cf2e7fb4ad3353fadc2a8a1efadd813a122c1d50 (diff) |
Clang: Fix build with MSVC2017/Clang 4.1
- Remove option -fPIC for Windows, fixing
error: unsupported option '-fPIC' for target 'x86_64-pc-windows-msvc'"
- Raise language level to prevent constexpr errors in MSVC libraries
Task-number: QTBUG-57086
Change-Id: Ic5bd84a8ce37c9f93d70d983257c98431aa18efe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp index eb3be115c..ea08ff6f9 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp +++ b/sources/shiboken2/ApiExtractor/clangparser/clangparser.cpp @@ -196,8 +196,14 @@ static CXTranslationUnit createTranslationUnit(CXIndex index, | CXTranslationUnit_Incomplete; static const QByteArrayList defaultArgs = { +#if defined(Q_CC_MSVC) && _MSC_VER > 1900 + "-std=c++1z", // Fixes constexpr errors in MSVC2017 library headers with Clang 4.1 +#else "-std=c++14", // ! otherwise, t.h is parsed as "C" +#endif +#ifndef Q_OS_WIN "-fPIC", +#endif "-fno-exceptions", // Workaround for clang bug http://reviews.llvm.org/D17988 #ifdef Q_OS_MACOS "-Wno-expansion-to-defined", // Workaround for warnings in Darwin stdlib, see |