-
Notifications
You must be signed in to change notification settings - Fork 24
/
wscript
43 lines (34 loc) · 1.05 KB
/
wscript
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
36
37
38
39
40
41
42
43
# run me like:
# python waf sw_configure sw_build configure build
import os
import subprocess
top = '.'
out = 'build_waf'
swdir = out + '/.sw'
swdeps = swdir + '/deps.txt'
def sw_configure(ctx):
deps = [
'org.sw.demo.sqlite3',
'org.sw.demo.glennrp.png',
]
os.makedirs(swdir, exist_ok=True)
f = open(swdeps, 'w')
for d in deps:
f.write(d + '\n')
f.close()
p = subprocess.Popen(['sw', '-mt', '-d', swdir, 'integrate', '-waf-deps', 'deps.txt'])
if p.wait():
ctx.fatal("Error during sw call")
def sw_build(ctx):
p = subprocess.Popen(['sw', '-mt', '-d', swdir, 'build', '@' + swdeps,
'-ide-copy-to-dir', '..', '-ide-fast-path', 'fp.txt'])
if p.wait():
ctx.fatal("Error during sw call")
def options(opt):
opt.load('compiler_cxx')
def configure(ctx):
ctx.load('compiler_cxx')
ctx.recurse(swdir)
def build(bld):
bld.program(source='sqlite3.cpp', target='sqlite3', use='org.sw.demo.sqlite3')
bld.program(source='png.cpp', target='png', use='org.sw.demo.glennrp.png')