diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-26 10:43:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-27 09:47:47 +0000 |
commit | d62278afd55c87101de7c7a9327f06cf5326af0b (patch) | |
tree | 2d3c20ceccff8220b860f84e8051890a4e79d4ed /sources/shiboken2/ApiExtractor/apiextractor.cpp | |
parent | 4a32f9d00b043b7255b590b95e9b35e9de44c4ed (diff) |
shiboken: No longer hard-code the C++ language level
The C++ language level was previously hard-coded in the default options.
This is potentially problematic for projects using shiboken and also
fell apart with Qt 5.12, where the experimental level "c++1z" used for
MSVC2017/Clang 4 no longer works due to not being able to handle
enumerator value deprecation attributes.
Introduce an enumeration to represent the level and add functions
to convert back to and forth to the respective Clang option.
Add an option to shiboken.
Add a function returning a default value for the emulated compiler,
returning C++ 14 or C++1Z for the CMSVC2017/Clang 4 case.
Task-number: PYSIDE-724
Change-Id: Ie7e19bf7f099a34e6cdaad4b462157a9a3ee8797
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/apiextractor.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/apiextractor.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/apiextractor.cpp b/sources/shiboken2/ApiExtractor/apiextractor.cpp index 4c4eaff6c..2dadda57a 100644 --- a/sources/shiboken2/ApiExtractor/apiextractor.cpp +++ b/sources/shiboken2/ApiExtractor/apiextractor.cpp @@ -259,8 +259,9 @@ bool ApiExtractor::run() for (const HeaderPath &headerPath : qAsConst(m_includePaths)) arguments.append(HeaderPath::includeOption(headerPath)); arguments.append(QFile::encodeName(preprocessedCppFileName)); - qCDebug(lcShiboken) << __FUNCTION__ << arguments; - const bool result = m_builder->build(arguments); + qCDebug(lcShiboken) << __FUNCTION__ << arguments + << "level=" << int(m_languageLevel); + const bool result = m_builder->build(arguments, m_languageLevel); if (!result) autoRemove = false; if (!autoRemove) { @@ -270,6 +271,16 @@ bool ApiExtractor::run() return result; } +LanguageLevel ApiExtractor::languageLevel() const +{ + return m_languageLevel; +} + +void ApiExtractor::setLanguageLevel(const LanguageLevel languageLevel) +{ + m_languageLevel = languageLevel; +} + #ifndef QT_NO_DEBUG_STREAM template <class Container> static void debugFormatSequence(QDebug &d, const char *key, const Container& c) |