diff --git a/wscript b/wscript index 56c8dfd..95b0e6b 100644 --- a/wscript +++ b/wscript @@ -1,4 +1,6 @@ + import glob +import Options srcdir = '.' blddir = 'build' @@ -6,13 +8,22 @@ VERSION = '0.0.1' def set_options(opt): opt.tool_options('compiler_cxx') + opt.add_option('--profile', action='store_true', help='Enable profiling', dest='profile', default=False) def configure(conf): + o = Options.options + conf.env['USE_PROFILING'] = o.profile conf.check_tool('compiler_cxx') conf.check_tool('node_addon') conf.env.append_value('CPPFLAGS', '-DNDEBUG') + if conf.check(lib='jpeg', uselib_store='JPEG', mandatory=False): conf.env.append_value('CPPFLAGS', '-DHAVE_JPEG=1') + + if conf.env['USE_PROFILING'] == True: + conf.env.append_value('CXXFLAGS', ['-pg']) + conf.env.append_value('LINKFLAGS', ['-pg']) + conf.check_cfg(package='cairo', args='--cflags --libs', mandatory=True) flags = ['-O3', '-Wall'] conf.env.append_value('CCFLAGS', flags)