def build(bld):
- obj = bld(features = 'cxx cxxshlib')
+ if bld.env.STATIC:
+ obj = bld(features = 'cxx cxxstlib')
+ else:
+ obj = bld(features = 'cxx cxxshlib')
obj.name = 'libcxml'
obj.target = 'cxml'
obj.export_includes = ['.']
obj.source = "cxml.cc"
bld.install_files('${PREFIX}/include/libcxml', "cxml.h")
+ if bld.env.STATIC:
+ bld.install_files('${PREFIX}/lib', 'libcxml.a')
+
def options(opt):
opt.load('compiler_cxx')
opt.add_option('--target-windows', action='store_true', default = False, help = 'set up to do a cross-compile to Windows')
+ opt.add_option('--static', action='store_true', default = False, help = 'build statically')
def configure(conf):
conf.load('compiler_cxx')
conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2'])
conf.env.TARGET_WINDOWS = conf.options.target_windows
+ conf.env.STATIC = conf.options.static
if conf.options.target_windows:
boost_lib_suffix = '-mt'