waf: (fixes #2387) Fix check-profile command
This commit is contained in:
14
wscript
14
wscript
@@ -749,7 +749,19 @@ def build(bld):
|
||||
env = bld.env
|
||||
|
||||
if Options.options.check_profile:
|
||||
print("Build profile: %s" % Options.options.build_profile)
|
||||
# Parse the waf lockfile generated by latest 'configure' operation
|
||||
lockfile = os.environ.get('WAFLOCK', '.lock-waf_%s_build' % sys.platform)
|
||||
profile = "not found"
|
||||
with open(lockfile, "r") as f:
|
||||
for line in f:
|
||||
if line.startswith("options ="):
|
||||
key, val = line.split('=')
|
||||
arr = val.split(',')
|
||||
for x in arr:
|
||||
optkey,optval = x.split(':')
|
||||
if (optkey.lstrip() == '\'build_profile\''):
|
||||
profile = str(optval.lstrip()).replace("'","")
|
||||
print("Build profile: %s" % profile)
|
||||
raise SystemExit(0)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user