简体   繁体   中英

How to cross compile cython with zig cc

Is there a way to cross compile cython project with zig cc . According to this blog zig can cross compile. An example which cross compiles cython hello world would be great.

You'd need the python headers for the target.

Once you have them, you should be able to run:

# Compile .pyx to .c
cython helloworld.pyx
# Use zig to compile+link
zig build-lib -dynamic -target x86_64-windows \
   -I mingw-w64-x86_64-python/mingw64/include/python3.10/ \
   -lc \
   mingw-w64-x86_64-python/mingw64/bin/libpython3.10.dll \
   helloworld.c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM