File: wscript

package info (click to toggle)
pybindgen 0.20.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,932 kB
  • sloc: python: 15,981; cpp: 1,889; ansic: 617; makefile: 86; sh: 4
file content (35 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## -*- python -*-
#import Action
#import Object
#import Params
#import Task
import os

if 0:
    DEPRECATION_ERRORS = '-Werror::DeprecationWarning' # deprecations become errors
else:
    DEPRECATION_ERRORS = '-Wdefault::DeprecationWarning' # normal python behaviour

def build(bld):
    if not bld.env['ENABLE_PYGCCXML']:
        print("gccxml not available; skipping the C hello demo")
        return

    bindgen = bld(
        features='command',
        source='hellomodulegen.py hello.h',
        target='hellomodule.c',
        command='${PYTHON} %s ${SRC[0]} ${PYGCCXML_MODE} ${SRC[1]}  > ${TGT[0]}' % (DEPRECATION_ERRORS,))

    os.environ["PYTHONPATH"] = os.pathsep.join([os.environ.get("PYTHONPATH", ''), bindgen.path.get_bld().abspath()])

    if bld.env['CXX']:
        obj = bld(features='c cshlib pyext')
        obj.source = [
            'hello.c',
            'hellomodule.c'
            ]
        obj.target = 'hello'
        obj.install_path = None # do not install
        obj.env.append_value("INCLUDES", '.')