How do I use waf to build a shared library?
- by James Morris
I want to build a shared library using waf as it looks much easier and less cluttered than GNU autotools.
I actually have several questions so far related to the wscript I've started to write:
VERSION='0.0.1'
APPNAME='libmylib'
srcdir = '.'
blddir = 'build'
def set_options(opt):
opt.tool_options('compiler_cc')
pass
def configure(conf):
conf.check_tool('compiler_cc')
conf.env.append_value('CCFLAGS', '-std=gnu99 -Wall -pedantic -ggdb')
def build(bld):
bld.new_task_gen(
features = 'cc cshlib',
source = '*.c',
target='libmylib')
The line containing source = '*.c' does not work. Must I specify each and every .c file instead of using a wildcard?
How can I enable a debug build for example (currently the wscript is using the debug builds CFLAGS, but I want to make this optional for the end user).
It is planned for the library sources to be within a sub directory, and programs that use the lib each in their own sub directories.