add native library with sip

This commit is contained in:
citronneur
2014-06-26 23:02:41 +02:00
parent 149d212d93
commit 1547eeda46
5 changed files with 919 additions and 0 deletions

27
lib/build/configure.py Normal file
View File

@@ -0,0 +1,27 @@
'''
@author: sylvain
'''
import os
import sipconfig
# The name of the SIP build file generated by SIP and used by the build
# system.
build_file = "rle.sbf"
# Get the SIP configuration information.
config = sipconfig.Configuration()
# Run SIP to generate the code.
os.system(" ".join([config.sip_bin, "-c", ".", "-b", build_file, "../src/rle.sip"]))
# Create the Makefile.
makefile = sipconfig.SIPModuleMakefile(config, build_file)
# Add the library we are wrapping. The name doesn't include any platform
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
# ".dll" extension on Windows).
makefile.extra_libs = ["rle"]
# Generate the Makefile itself.
makefile.generate()

11
lib/build/rle.sip Normal file
View File

@@ -0,0 +1,11 @@
%Module rle
namespace rle {
%TypeHeaderCode
#include <rle.h>
%End
int decode_uint8(char* output, int width, int height, char* input, int size);
int decode_uint16(char* output, int width, int height, char* input, int size);
int decode_uint24(char* output, int width, int height, char* input, int size);
};