Reputation: 1908
This is a query related to the network simulator called NS3.
Say that I want to build a program called 'MyProgram' and to link a shared library when building it. How do I do this with WAF? I have put 'MyProgram' in a directory called 'examples/thesis' and created a wscript. I am also putting the files needed for 'MyProgram' in the scratch-directory. [Some more info about the usage of WAF when building files in NS3: Link ]
This is the command that I would run to build 'MyProgram' without the library: ./waf --build MyProgram
How do I link the library the shared library when building 'MyProgram'?
Thanks in advance!
Upvotes: 1
Views: 1295
Reputation: 21
You can use the lib
named argument to pass a list of libraries into program.
def build(ctx):
ctx(rule='cp ${SRC} ${TGT}', source='src/main.c', target='main.c')
ctx.program(source='main.c', target='app', lib=['mysqlclient'])
Upvotes: 2