Age | Commit message (Collapse) | Author |
|
|
|
GIT_SILENT
|
|
|
|
|
|
Summary: Correct spelling in extra-cmake-modules comments.
Reviewers: apol
Reviewed By: apol
Subscribers: kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D25752
|
|
Test Plan: kcoreaddons compiles again
Reviewers: lbeltrame
Reviewed By: lbeltrame
Subscribers: cgiboudeaux, skelly, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D18345
|
|
Summary:
Depending on the locale, python3 may try to decode the source as ASCII
when the file is opened in text mode. This will fail as soon as the
code contains utf-8, e.g. (c) symbols.
While it is possible to specify the encoding when reading the file,
this is bad for several reasons:
- only a very small part of the source is processed via _read_source,
no need to decode the complete source and store it as string objects
- the clang Cursor.extent.{start,end}.column refers to bytes, not
multibyte characters.
While python2 processes utf-8 containing sources without error messages,
wrong extent borders are also an issue.
The practical impact is low, as the issue only manifests if there is a
multibyte character in front of *and* on the same line as the read token.
Test Plan:
Python3: Build any bindings which contains sources with non-ASCII codepoints,
e.g. kcoreaddons. Unpatched version fails when using e.g. LANG=C.
Python2: Both versions generate sources successfully.
Bytes vs characters test:
```
#define Q_SLOTS
class foo {
/* a */ public Q_SLOTS:
/* ä */ public Q_SLOTS:
};
```
`sip_generator.py --flags "" /usr/lib64/libclang.so Qt5Ruleset.py test.h out.sip`
Obviously, both lines should result in the same code, the unfixed version generates `public Q_SLOTS:` vs `public:`.
Reviewers: #frameworks, lbeltrame
Reviewed By: lbeltrame
Subscribers: lbeltrame, bcooksley, jtamate, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D15068
|
|
Summary:
Keep the enum intact by emitting the class keyword in case the enum is
scoped.
Use the complete enum scope for parameter values, the enclosing scope is
only correct to use for unscoped enums.
The python Cursor.is_scoped_enum() method has been added with LLVM/Clang
version 5.0.
BUG: 397154
Test Plan: build kcoreaddons
Reviewers: #frameworks, mpyne
Reviewed By: mpyne
Subscribers: mpyne, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D14908
|
|
With some combination of PyQt/compiler this breaks the build of
kcoreaddons.
This reverts commit 2e20aeab6e86670a66ff99a7b79120c4004b4d22.
|
|
This should have been removed in a prior commit.
|
|
|
|
|
|
Don't export API which has visibility "hidden".
Visibility attributes on variables are ignored, but call the generic
method anyway.
Remove checks for macros which obscure the attributes. Processing the
attribute directly means that is not needed.
|
|
De-duplicate it between variables and functions. The callers already
handle reporting the removal.
|
|
|
|
|
|
|
|
Clang API is odd.
|
|
|
|
|
|
|
|
Don't prepend a namespace to it as we do otherwise with enum/flags.
|
|
Allow modifying the name also.
|
|
Don't process the same function name twice.
|
|
It is not appropriate to decorate each forward declaration with the SIP
attribute /External/. That is only needed for forward declarations of
types which are defined in a different module.
Local forward declarations can be omitted from the sip code. In sip
code, a forward declaration followed later by a full class definition is
an error.
Omit forward declarations unless they are decorated with the external
attribute. Introduce a rules database for consumers to decorate them
with the attribute as required.
|
|
Custom rules should be able to deal with lists in these cases. This is
already the case for function parameters.
|
|
Currently this is rather simple, allowing only matching typedefs by
name. If we need more later, we can extend the interface. This will
make it possible to add bindings for the K18n framework.
|
|
|
|
Don't use the text 'Parse error' for warnings, which might confuse IDEs.
|
|
The Python logging module uses logging severities with numerical values
which form a sequence in steps of 10. The Clang cindex.Diagnostic
numerical values use a step size of 1, so the two are incompatible.
Introduce a mapping function so that appropriate errors get issued when
attempting to build the bindings. The logging module has one surplus
diagnostic level, but we simply never use it.
BUG: 374801
|
|
The Q_DECLARE_TR_FUNCTIONS macro contains a `public:` access specifier,
but the sip_generator just pastes the entire macro name. Adjust the
generator to extract the correct access specifier.
|
|
Note which rule has a modification effect.
|
|
|
|
These files process C++ headers with libclang and python-clang bindings,
using the AST to generate SIP files for PyQt binding library generation.
The design allows for further extensions which can process other
artifacts found in headers. This iteration of the design is a simple
minimum which suffices to generate headers for KItemModels and some
other libraries.
|