-
Notifications
You must be signed in to change notification settings - Fork 5
/
wscript.bak
90 lines (70 loc) · 2.2 KB
/
wscript.bak
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import urllib2
import os.path
APPNAME = 'kge'
VERSION = '0.1.0'
top = '.'
out = 'bin'
outsdl = out + 'sdlcmake'
url = ''
saveto = ''
def download(url, saveto):
file_name = saveto + '/' + url.split('/')[-1]
if os.path.isfile(file_name):
print file_name + " already exist."
return
u = urllib2.urlopen(url)
f = open(file_name, 'wb')
meta = u.info()
file_size = int(meta.getheaders("Content-Length")[0])
print "Downloading: %s Bytes: %s" % (file_name, file_size)
file_size_dl = 0
block_sz = 8192
while True:
buffer = u.read(block_sz)
if not buffer:
break
file_size_dl += len(buffer)
f.write(buffer)
status = r"%10d [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
status = status + chr(8)*(len(status)+1)
print status,
f.close()
def options(opt):
opt.load('compiler_c compiler_cxx')
def configure(conf):
# download("https://github.com/kochol/kge/releases/download/0.1.0/kge010.zip", "Libs")
conf.load('compiler_c compiler_cxx')
conf.setenv('debug')
conf.check_cfg(package='sdl2', uselib_store='SDL2',
args=['--cflags', '--libs'])
def build(bld):
print 'C Flags:', bld.env['CFLAGS']
print 'CXX Flags:', bld.env['CXXFLAGS']
print 'Linker Flags:', bld.env['LINKFLAGS']
print 'Defines:', bld.env['DEFINES']
# print 'Building SDL2 please wait ...'
# bld(rule='touch sdlcmake;cd sdlcmake;cmake ../../Libs/SDL;make;cd ..')
bld.read_shlib('SDL2')
bld.read_shlib('IL', paths=['Libs'])
bld.read_shlib('ILU', paths=['Libs'])
# bld.read_shlib('glew')
# Add source files
files = []
files.extend(bld.path.ant_glob("Source/*.cpp"))
files.extend(bld.path.ant_glob("Source/*/*.cpp"))
files.extend(bld.path.ant_glob("Libs/stb_image.c"))
# Bulid KGE
bld.shlib(
source = files,
target = "kge",
name = "kge",
uselib = 'SDL2',
lib = ['SDL2'],
# includes = ['SDL2'],
cxxflags = ['-fpermissive', '-Wall'],
use = ['SDL2', 'IL', 'ILU']
)
# Build Plugins
bld.recurse('plugins')
# Build tutorials
bld.recurse('tutorials/tut01')