| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
for base 2 integer constant as well.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
S: can't use u prefixes, as it is syntax error there
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* PkgConfigNotFound - not installed
* PkgConfigError - base pkg-config errors
* PkgConfigModuleNotFound - pc file for module was not found
* PkgConfigModuleVersionNotFound - requested version was not found
Boilerplate now looks
```
from cffi.error import PkgConfigNotFound, PkgConfigError
...
try:
# try pkg-config way
ffibuilder.set_source(..., pkgconfig=["libczmq >= 4.0.0"])
except PkgConfigNotFound as e:
# if pkg-config is not installed, try backup
ffibuilder.set_source(..., libraries=["czmq", "zmq", "uuid", "pgm"])
except PkgConfigError as e:
# here we catch both PkgConfigModuleNotFound and PkgConfigModuleVersionNotFound
# and raise it again - simply to show they are raised
raise e from None
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now the with non pkg-config backup would be
```
module_name = "_czmq"
source = "#include <czmq.h>"
try:
print(f"### pkg-config path")
ffibuilder.set_source(
module_name,
source,
pkgconfig=["libczmq"]
)
except Exception as e:
print(f"Exception e: {e}")
ffibuilder.set_source(
module_name,
source,
libraries=["czmq"]
)
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix encoding errors
Given testing Python program
```
from cffi import FFI
ffibuilder = FFI()
ffibuilder.cdef(
"char* zsys_hostname();"
)
ffibuilder.set_source(
"_czmq",
"#include <czmq.h>",
pkgconfig=["libczmq"]
)
if __name__ == "__main__":
ffibuilder.compile(verbose=True)
```
We can run ffibuilder from source dir of czmq
```
PKG_CONFIG_PATH=`pwd`/src python3 t.py
generating ./_czmq.c
...
gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/local/lib64 -L/usr/lib64 -lczmq -lzmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so
```
```
python3 t.py
generating ./_czmq.c
...
gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/lib64 -lczmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so
```
Note that in the first case `/usr/local` has been added to the compiler path as
provided by local pkg-config file.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Making `pkgconfig.call` function accessible, tests can monkey patch it and
provide mock. This improves testing, however raised a need to give
functions better names than `pkgconfig.pkgconfig_kwargs` or `pkgconfig.pc`.
|
| |
| |
| |
| | |
use bytes instead of strings
|
| | |
|
| |
| |
| |
| | |
read extra_compile_args and extra_link_args fom pkg-config too
|
| | |
|
| |
| |
| |
| | |
Add pkg-config wrapper, which is the cross-platform tool telling exactly this.
|
| |
| |
| |
| |
| | |
Also contains some improvements to the documentation about other recent
additions
|
| | |
|
| |
| |
| |
| | |
Workaround for a pycparser issue.
|
| |
| |
| |
| | |
Implement ffi.from_buffer(x, require_writable=True)
|
|\ \
| | |
| | |
| | | |
Move test-only function from cffi/ to testing/
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
Warn when using string literals in the cdef() source
|
| |
| |
| |
| |
| | |
See ``"python3 setup.py sdist" wrongly packages auto-generated file
(out-of-line ABI-mode)`` on the mailing list.
|
| |
| |
| |
| | |
Accept ``ffi.new("int[4]", p)`` if p is itself another cdata ``int[4]``.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fix?
|
| | |
|
| |
| |
| |
| | |
Add support for MSVC's "#pragma pack(n)" in ABI mode
|
| | |
|
| |
| |
| |
| | |
(see issue #345)
|
| |
| |
| |
| | |
Fix following recent changes to CPython 2.7
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Usually makes no difference, except if you use "install --record=xx
--root=yy".
|
| |
| |
| |
| | |
containing anonymous unions or vice-versa
|