diff options
Diffstat (limited to 'sources')
14 files changed, 71 insertions, 43 deletions
diff --git a/sources/pyside6/PySide6/QtCore/CMakeLists.txt b/sources/pyside6/PySide6/QtCore/CMakeLists.txt index d559f9d96..fff6cc8b0 100644 --- a/sources/pyside6/PySide6/QtCore/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtCore/CMakeLists.txt @@ -19,9 +19,6 @@ if(ENABLE_WIN) set(SPECIFIC_OS_FILES ${QtCore_GEN_DIR}/qwineventnotifier_wrapper.cpp ) -else() - set(SPECIFIC_OS_FILES - ${QtCore_GEN_DIR}/qprocess_unixprocessparameters_wrapper.cpp) endif() set(QtCore_SRC @@ -130,8 +127,6 @@ ${QtCore_GEN_DIR}/qpersistentmodelindex_wrapper.cpp ${QtCore_GEN_DIR}/qpluginloader_wrapper.cpp ${QtCore_GEN_DIR}/qpoint_wrapper.cpp ${QtCore_GEN_DIR}/qpointf_wrapper.cpp -${QtCore_GEN_DIR}/qprocess_wrapper.cpp -${QtCore_GEN_DIR}/qprocessenvironment_wrapper.cpp ${QtCore_GEN_DIR}/qpropertyanimation_wrapper.cpp ${QtCore_GEN_DIR}/qrandomgenerator64_wrapper.cpp ${QtCore_GEN_DIR}/qrandomgenerator_wrapper.cpp @@ -236,6 +231,23 @@ else() list(APPEND QtCore_SRC ${QtCore_GEN_DIR}/qsharedmemory_wrapper.cpp) endif() +if("process" IN_LIST QtCore_disabled_features) + list(APPEND QtCore_DROPPED_ENTRIES QProcess) + message(STATUS "Qt${QT_MAJOR_VERSION}Core: Dropping QProcess") +else() + list(APPEND QtCore_SRC ${QtCore_GEN_DIR}/qprocess_wrapper.cpp) + if(NOT ENABLE_WIN) + list(APPEND QtCore_SRC ${QtCore_GEN_DIR}/qprocess_unixprocessparameters_wrapper.cpp) + endif() +endif() + +if("processenvironment" IN_LIST QtCore_disabled_features) + list(APPEND QtCore_DROPPED_ENTRIES QProcessEnvironment) + message(STATUS "Qt${QT_MAJOR_VERSION}Core: Dropping QProcessEnvironment") +else() + list(APPEND QtCore_SRC ${QtCore_GEN_DIR}/qprocessenvironment_wrapper.cpp) +endif() + configure_file("${QtCore_SOURCE_DIR}/QtCore_global.post.h.in" "${QtCore_BINARY_DIR}/QtCore_global.post.h" @ONLY) diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml index c3130ccb2..26c3ecab1 100644 --- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml +++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml @@ -2669,7 +2669,9 @@ <?if !windows?> <enum-type name="UnixProcessFlag" flags="UnixProcessFlags" since="6.6"/> - <value-type name="UnixProcessParameters" since="6.6"/> + <value-type name="UnixProcessParameters"> + <configuration condition="QT_CONFIG(process)"/> + </value-type> <?endif?> <modify-function signature="waitForStarted(int)" allow-thread="yes"/> diff --git a/sources/pyside6/cmake/PySideSetup.cmake b/sources/pyside6/cmake/PySideSetup.cmake index 45a63a1a0..a3bc1c738 100644 --- a/sources/pyside6/cmake/PySideSetup.cmake +++ b/sources/pyside6/cmake/PySideSetup.cmake @@ -246,6 +246,7 @@ ENDIF() set(GENERATOR_EXTRA_FLAGS ${SHIBOKEN_GENERATOR_EXTRA_FLAGS} ${debug_level} + "--platform=${CMAKE_SYSTEM_NAME}" ${UNOPTIMIZE} --generator-set=shiboken --enable-parent-ctor-heuristic diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp index 5188262de..81d7bd92f 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp @@ -827,6 +827,7 @@ BuilderPrivate::SpecialSystemHeader } switch (clang::platform()) { + case Platform::Linux: case Platform::Unix: if (fileName == u"/usr/include/stdlib.h" || baseName == u"types.h" diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp index 4d93a084f..f8bcf1244 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp @@ -86,12 +86,18 @@ Platform platform() { return _platform; } bool setPlatform(const QString &name) { bool result = true; - if (name == u"windows") + if (name.compare("unix"_L1, Qt::CaseInsensitive) == 0) + _platform = Platform::Unix; + else if (name.compare("linux"_L1, Qt::CaseInsensitive) == 0) + _platform = Platform::Linux; + if (name.compare("windows"_L1, Qt::CaseInsensitive) == 0) _platform = Platform::Windows; - else if (name == u"darwin") + else if (name.compare("darwin"_L1, Qt::CaseInsensitive) == 0) _platform = Platform::macOS; - else if (name == u"unix") - _platform = Platform::Unix; + else if (name.compare("android"_L1, Qt::CaseInsensitive) == 0) + _platform = Platform::Android; + else if (name.compare("ios"_L1, Qt::CaseInsensitive) == 0) + _platform = Platform::iOS; else result = false; return result; diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h index 0e12ca137..2b1898a7e 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h +++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.h @@ -26,8 +26,11 @@ enum class Compiler { enum class Platform { Unix, + Linux, Windows, - macOS + macOS, + Android, + iOS }; namespace clang { diff --git a/sources/shiboken6/ApiExtractor/conditionalstreamreader.cpp b/sources/shiboken6/ApiExtractor/conditionalstreamreader.cpp index 6b9f0ae2e..88079a630 100644 --- a/sources/shiboken6/ApiExtractor/conditionalstreamreader.cpp +++ b/sources/shiboken6/ApiExtractor/conditionalstreamreader.cpp @@ -158,24 +158,7 @@ bool ConditionalStreamReader::conditionMatches() const void ConditionalStreamReader::setConditions(const QStringList &newConditions) { - m_conditions = newConditions + platformConditions(); -} - -QStringList ConditionalStreamReader::platformConditions() -{ - QStringList result; -#if defined (Q_OS_UNIX) - result << "unix"_L1; -#endif - -#if defined (Q_OS_LINUX) - result << "linux"_L1; -#elif defined (Q_OS_MACOS) - result << "darwin"_L1; -#elif defined (Q_OS_WINDOWS) - result << "windows"_L1; -#endif - return result; + m_conditions = newConditions; } ConditionalStreamReader::ExtendedToken ConditionalStreamReader::readNextInternal() diff --git a/sources/shiboken6/ApiExtractor/conditionalstreamreader.h b/sources/shiboken6/ApiExtractor/conditionalstreamreader.h index 36c4752a4..d9af5dc1e 100644 --- a/sources/shiboken6/ApiExtractor/conditionalstreamreader.h +++ b/sources/shiboken6/ApiExtractor/conditionalstreamreader.h @@ -69,8 +69,6 @@ public: const QStringList &conditions() const { return m_conditions; } void setConditions(const QStringList &newConditions); - static QStringList platformConditions(); - private: enum class PiTokens { None, If, Endif, EntityDefinition }; @@ -82,7 +80,7 @@ private: QXmlStreamReader m_reader; ProxyEntityResolver *m_proxyEntityResolver = nullptr; - QStringList m_conditions = ConditionalStreamReader::platformConditions(); + QStringList m_conditions; }; QDebug operator<<(QDebug dbg, const QXmlStreamAttributes &a); diff --git a/sources/shiboken6/ApiExtractor/docparser.cpp b/sources/shiboken6/ApiExtractor/docparser.cpp index 6fdabfa05..f3c51085a 100644 --- a/sources/shiboken6/ApiExtractor/docparser.cpp +++ b/sources/shiboken6/ApiExtractor/docparser.cpp @@ -22,10 +22,6 @@ #include "qtcompat.h" #include <cstdlib> -#ifdef HAVE_LIBXSLT -# include <libxslt/xsltutils.h> -# include <libxslt/transform.h> -#endif #include <algorithm> diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp index b598258a6..ed2ea3ca6 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp @@ -6,6 +6,7 @@ #include "addedfunction.h" #include "messages.h" #include "typesystemparser_p.h" +#include "clangparser/compilersupport.h" #include "complextypeentry.h" #include "constantvaluetypeentry.h" #include "containertypeentry.h" @@ -433,10 +434,32 @@ void TypeDatabase::addRequiredTargetImport(const QString& moduleName) d->m_requiredTargetImports << moduleName; } +static QStringList platformKeywords() +{ + static constexpr auto unixKeyword = "unix"_L1; + static constexpr auto linuxKeyword = "linux"_L1; + switch (clang::platform()) { + case Platform::Unix: + return {unixKeyword}; + case Platform::Linux: + return {unixKeyword, linuxKeyword}; + case Platform::Windows: + return {"windows"_L1}; + case Platform::macOS: + return {unixKeyword, "darwin"_L1}; + case Platform::Android: + return {unixKeyword, linuxKeyword, "android"_L1}; + case Platform::iOS: + return {unixKeyword, "ios"_L1}; + } + return {}; +} + QStringList TypeDatabase::typesystemKeywords() const { - QStringList result = d->m_typesystemKeywords; - for (const auto &d : d->m_dropTypeEntries) + QStringList result = d->m_typesystemKeywords + platformKeywords(); + + for (const auto &d : std::as_const(d->m_dropTypeEntries)) result.append("no_"_L1 + d); switch (clang::emulatedCompilerLanguageLevel()) { diff --git a/sources/shiboken6/generator/main.cpp b/sources/shiboken6/generator/main.cpp index fd395180c..892f1cf6b 100644 --- a/sources/shiboken6/generator/main.cpp +++ b/sources/shiboken6/generator/main.cpp @@ -193,8 +193,10 @@ bool CommonOptionsParser::handleOption(const QString &key, const QString &value, return true; } if (key == u"platform") { - if (!clang::setPlatform(value)) - throw Exception(u"Invalid value \""_s + value + u"\" passed to --platform"_s); + if (!clang::setPlatform(value)) { + qCWarning(lcShiboken, "Invalid value \"%s\" passed to --platform, defaulting to host.", + qPrintable(value)); + } return true; } diff --git a/sources/shiboken6/generator/shiboken/headergenerator.cpp b/sources/shiboken6/generator/shiboken/headergenerator.cpp index 7616fa5c3..8c8f72241 100644 --- a/sources/shiboken6/generator/shiboken/headergenerator.cpp +++ b/sources/shiboken6/generator/shiboken/headergenerator.cpp @@ -187,7 +187,7 @@ void HeaderGenerator::writeWrapperClass(TextStream &s, } s << "#include <sbkpython.h>\n\n#include <array>\n"; - s << "namespace Shiboken { class AutoDecRef; class GilState; }\n\n"; + s << "namespace Shiboken { struct AutoDecRef; class GilState; }\n\n"; if (usePySideExtensions() && isQObject(metaClass)) s << "namespace PySide { class DynamicQMetaObject; }\n\n"; diff --git a/sources/shiboken6/libshiboken/sbkbindingutils.h b/sources/shiboken6/libshiboken/sbkbindingutils.h index e40089ed2..4ed833dfa 100644 --- a/sources/shiboken6/libshiboken/sbkbindingutils.h +++ b/sources/shiboken6/libshiboken/sbkbindingutils.h @@ -8,7 +8,7 @@ #include "shibokenmacros.h" namespace Shiboken { -class AutoDecRef; +struct AutoDecRef; /// Maps a keyword argument by name to its parameter index struct ArgumentNameIndexMapping diff --git a/sources/shiboken6/tests/CMakeLists.txt b/sources/shiboken6/tests/CMakeLists.txt index 05f6e9e60..37b80238f 100644 --- a/sources/shiboken6/tests/CMakeLists.txt +++ b/sources/shiboken6/tests/CMakeLists.txt @@ -23,7 +23,8 @@ else() message(STATUS "Tests will be generated using the protected hack!") set(GENERATOR_EXTRA_FLAGS ) endif() -list(APPEND GENERATOR_EXTRA_FLAGS ${SHIBOKEN_GENERATOR_EXTRA_FLAGS} ${debug_level}) +list(APPEND GENERATOR_EXTRA_FLAGS ${SHIBOKEN_GENERATOR_EXTRA_FLAGS} ${debug_level} + "--platform=${CMAKE_SYSTEM_NAME}") add_subdirectory(minimalbinding) if(NOT DEFINED MINIMAL_TESTS) |