-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwscript
85 lines (64 loc) · 2.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
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
#!/usr/bin/env python
# encoding: utf-8
import os
import wurf_cxx_mkspec
import wurf_configure_output
import wurf_runner
import wurf_install_path
import wurf_project_generator
import wurf_android_soname
import wurf_copy_binary
import wurf_limit_includes
import wurf_default_prefix
import wurf_cxx_version
from waflib import Options
from waflib.Configure import conf
@conf
def load_external_waf_tool(ctx, name):
"""
Load an additional external tool from the top-level wscript of a project.
:param ctx: the resolve, build or configuration context
"""
import inspect
this_file = inspect.getfile(inspect.currentframe())
path = os.path.join(os.path.dirname(this_file))
ctx.load([name], tooldir=[path])
@conf
def get_tool_option(conf, option):
# Options can be specified in 2 ways:
# 1) Passed with the currently executed command
# 2) Stored during the configure step
current = Options.options.__dict__
stored = conf.env.stored_options
if option in current and current[option] != None:
return current[option]
elif option in stored and stored[option] != None:
return stored[option]
else:
conf.fatal("Missing option: %s" % option)
@conf
def has_tool_option(conf, option):
current = Options.options.__dict__
stored = conf.env.stored_options
if option in current and current[option] != None:
return True
elif option in stored and stored[option] != None:
return True
else:
return False
def options(opt):
opt.load("wurf_install_path")
opt.load("wurf_cxx_mkspec")
opt.load("wurf_runner")
opt.load("wurf_default_prefix")
def configure(conf):
# Store the options that are specified during the configure step
conf.env["stored_options"] = Options.options.__dict__.copy()
if not conf.env["DISABLE_WURF_CXX_MKSPEC"]:
conf.load("wurf_cxx_mkspec")
conf.load("wurf_runner")
conf.load("wurf_install_path")
conf.load("wurf_project_generator")
conf.load("wurf_cxx_version")
def build(bld):
bld.load("wurf_install_path")