-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
77 lines (60 loc) · 2.03 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
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
import os, sys
APPNAME = 'gmath'
VERSION = '2.0'
top = '.'
out = 'build'
def options(ctx):
ctx.load('compiler_cxx')
ctx.load('doxygen', tooldir="./waftools")
grp = ctx.get_option_group('Configuration options')
grp.add_option('--doc-out-path', default='./documentation',
help='documentation install path [default: %default]')
def configure(conf):
conf.load('compiler_cxx')
conf.load('doxygen', tooldir="./waftools")
print sys.platform
if sys.platform=="win32":
conf.env.append_value('DEFINES', ['WINDOWS'])
elif sys.platform=="darwin":
conf.env.append_value('DEFINES', ['MAC'])
elif sys.platform=="linux2":
conf.env.append_value('DEFINES', ['LINUX'])
debenv = conf.env.derive().detach()
if sys.platform=="win32":
conf.env.append_value('CXXFLAGS', ['-EHsc'])
conf.env.append_value('DEFINES', ['RELEASE'])
conf.setenv('debug', debenv)
debenv.append_value('CXXFLAGS', ['-O2', '-g'])
debenv.append_value('DEFINES', ['DEBUG'])
from waflib.Build import BuildContext, InstallContext
class debug(BuildContext):
'''Build the debug variant'''
cmd = 'debug'
variant = 'debug'
class installdebug(InstallContext):
'''Install the debug variant'''
cmd = 'install-debug'
variant = 'debug'
def build(ctx):
source = ctx.path.find_node("source").ant_glob("*.cpp")
ctx.stlib(
target='gmath',
includes='include',
source=source,
name="gmath-static",
install_path = ctx.env.LIBDIR
)
ctx.shlib(
target='gmath',
includes='include',
source=source,
features = 'cxx cxxshlib',
name="gmath-shared",
install_path = ctx.env.LIBDIR
)
if ctx.env.DOXYGEN:
ctx.add_group()
ctx(name="doc",
features="doxygen",
doxyfile='./resources/doxygen/doxy_config',
install_path=ctx.options.doc_out_path)