-
January 28th, 2017, 12:52 PM
#1
[RESOLVED] python / perl / waf
I'm not quite sure where to put this question but here goes...
I'm using MSVC to build a program which normally gets built (on Windows) using gcc. The gcc build gets done via waf - which (I believe?) is essentially python.
It's a C++ program so obviously, my MSVC project processes the various C and CPP files. Also, there's a pre-build step which runs a perl script to process some external files.
I'm no expert with either python nor perl - but one of the waf wscript files contains a section which looks like this:-
Code:
# NATIVE BINDING FILES
# explicitly state the use of perl here so that it works on windows too
#
a_rule = 'perl ../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap ${SRC[0].abspath()} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
for b in [ 'ardour' ] :
obj = bld(
target = b + '.keys',
source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings' ],
rule = a_rule
)
obj.install_path = bld.env['CONFDIR']
To my untrained eye, it looks like the above defers to perl somehow in order to process some external files (ardour.keys.in / mixer.bindings etc). Given that I'm already running a small perl script, is there any way the above could get converted to perl (so that I could just add it to my existing perl script)?
I'm not sure what ${SRC[0].abspath() means in the above code - or $(TGT). Some aspect of waf maybe?
Last edited by John E; January 28th, 2017 at 01:02 PM.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
January 29th, 2017, 12:42 PM
#2
Re: python / perl / waf
I figured it out.!
Taking ardour.keys.in as an example... I just need to add the following line (as a pre-build step, in my MSVC project):-
Code:
perl ../tools/fmt-bindings --platform="windows" --winkey="Win" --accelmap path/to/ardour.keys.in > path/to/required/output.file
(and then the same for each of the other input files).
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|