2015-05-06 14:23:30 -04:00
|
|
|
#!/usr/bin/env python
|
2013-04-04 00:32:52 -04:00
|
|
|
from waflib.extras import autowaf as autowaf
|
|
|
|
from waflib import Options
|
|
|
|
from waflib import TaskGen
|
|
|
|
import os
|
|
|
|
|
|
|
|
# Version of this package (even if built as a child)
|
|
|
|
MAJOR = '0'
|
|
|
|
MINOR = '0'
|
|
|
|
MICRO = '0'
|
|
|
|
CANVAS_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
|
|
|
|
|
|
|
|
# Library version (UNIX style major, minor, micro)
|
|
|
|
# major increment <=> incompatible changes
|
|
|
|
# minor increment <=> compatible changes (additions)
|
|
|
|
# micro increment <=> no interface changes
|
|
|
|
CANVAS_LIB_VERSION = '0.0.0'
|
|
|
|
|
|
|
|
# Variables for 'waf dist'
|
|
|
|
APPNAME = 'canvas'
|
|
|
|
VERSION = CANVAS_VERSION
|
|
|
|
I18N_PACKAGE = 'libcanvas'
|
|
|
|
|
|
|
|
# Mandatory variables
|
|
|
|
top = '.'
|
|
|
|
out = 'build'
|
|
|
|
|
|
|
|
path_prefix = 'libs/canvas/'
|
|
|
|
|
|
|
|
canvas_sources = [
|
2013-04-18 21:29:13 -04:00
|
|
|
'arc.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'arrow.cc',
|
2016-09-25 15:46:07 -04:00
|
|
|
'box.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'canvas.cc',
|
2013-04-18 15:47:30 -04:00
|
|
|
'circle.cc',
|
2014-06-21 11:43:42 -04:00
|
|
|
'container.cc',
|
2013-04-11 22:54:12 -04:00
|
|
|
'curve.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'debug.cc',
|
|
|
|
'item.cc',
|
|
|
|
'fill.cc',
|
2013-04-04 00:32:52 -04:00
|
|
|
'flag.cc',
|
2016-05-17 13:26:18 -04:00
|
|
|
'framed_curve.cc',
|
2017-01-14 07:56:04 -05:00
|
|
|
'grid.cc',
|
2013-04-15 21:40:15 -04:00
|
|
|
'image.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'line.cc',
|
2013-04-04 00:32:52 -04:00
|
|
|
'line_set.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'lookup_table.cc',
|
2016-09-25 16:01:26 -04:00
|
|
|
'meter.cc',
|
2018-07-03 11:21:53 -04:00
|
|
|
'note.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'outline.cc',
|
|
|
|
'pixbuf.cc',
|
|
|
|
'poly_item.cc',
|
|
|
|
'poly_line.cc',
|
|
|
|
'polygon.cc',
|
|
|
|
'rectangle.cc',
|
|
|
|
'root_group.cc',
|
2014-06-11 23:51:59 -04:00
|
|
|
'ruler.cc',
|
2014-05-20 23:08:15 -04:00
|
|
|
'scroll_group.cc',
|
2014-02-17 16:05:52 -05:00
|
|
|
'stateful_image.cc',
|
2018-08-13 08:56:53 -04:00
|
|
|
'step_button.cc',
|
2021-09-14 00:00:21 -04:00
|
|
|
'table.cc',
|
2013-04-04 00:32:52 -04:00
|
|
|
'text.cc',
|
2014-06-26 15:05:21 -04:00
|
|
|
'tracking_text.cc',
|
2013-07-14 13:38:52 -04:00
|
|
|
'types.cc',
|
|
|
|
'utils.cc',
|
2014-06-03 23:57:12 -04:00
|
|
|
'widget.cc',
|
2014-05-28 21:09:57 -04:00
|
|
|
'xfade_curve.cc',
|
2013-04-04 00:32:52 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
def options(opt):
|
|
|
|
autowaf.set_options(opt)
|
|
|
|
|
|
|
|
def configure(conf):
|
2013-07-14 13:38:52 -04:00
|
|
|
autowaf.check_pkg(conf, 'cairomm-1.0', uselib_store='CAIROMM', atleast_version='1.8.4')
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
# Library
|
|
|
|
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
|
2013-07-14 13:38:52 -04:00
|
|
|
obj = bld.shlib(features = 'cxx cxxshlib', source=canvas_sources)
|
2013-12-27 16:24:58 -05:00
|
|
|
obj.defines = [ 'LIBCANVAS_DLL_EXPORTS=1' ]
|
2013-04-04 00:32:52 -04:00
|
|
|
else:
|
2013-07-14 13:38:52 -04:00
|
|
|
obj = bld.stlib(features = 'cxx cxxstlib', source=canvas_sources)
|
2020-01-13 18:52:01 -05:00
|
|
|
obj.cxxflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
|
|
|
obj.cflags = [ bld.env['compiler_flags_dict']['pic'] ]
|
|
|
|
obj.defines = [ ]
|
2015-11-29 11:52:42 -05:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
obj.export_includes = ['.']
|
|
|
|
obj.includes = ['.']
|
2020-01-20 22:35:40 -05:00
|
|
|
obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML OSX'
|
2017-07-17 14:12:33 -04:00
|
|
|
obj.use = [ 'libpbd', 'libgtkmm2ext' ]
|
2013-04-04 00:32:52 -04:00
|
|
|
obj.name = 'libcanvas'
|
|
|
|
obj.target = 'canvas'
|
|
|
|
obj.vnum = CANVAS_LIB_VERSION
|
2014-04-28 21:18:02 -04:00
|
|
|
obj.install_path = bld.env['LIBDIR']
|
2014-03-01 16:52:08 -05:00
|
|
|
obj.defines += [ 'PACKAGE="' + I18N_PACKAGE + '"' ]
|
2015-11-29 11:52:42 -05:00
|
|
|
|
2016-02-28 15:16:44 -05:00
|
|
|
# canvas unit-tests are outdated
|
|
|
|
if False and bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
|
|
|
|
unit_testobj = bld(features = 'cxx cxxprogram')
|
|
|
|
unit_testobj.source = '''
|
|
|
|
test/group.cc
|
|
|
|
test/arrow.cc
|
|
|
|
test/optimizing_lookup_table.cc
|
|
|
|
test/polygon.cc
|
|
|
|
test/types.cc
|
|
|
|
test/render.cc
|
|
|
|
test/xml.cc
|
|
|
|
test/wave_view.cc
|
|
|
|
test/item.cc
|
|
|
|
test/testrunner.cpp
|
|
|
|
'''.split()
|
|
|
|
|
|
|
|
unit_testobj.includes = obj.includes + ['test', '../pbd']
|
|
|
|
unit_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
|
2017-07-17 14:12:33 -04:00
|
|
|
unit_testobj.uselib_local = 'libcanvas libgtkmm2ext'
|
2016-02-28 15:16:44 -05:00
|
|
|
unit_testobj.name = 'libcanvas-unit-tests'
|
|
|
|
unit_testobj.target = 'run-tests'
|
|
|
|
unit_testobj.install_path = ''
|
|
|
|
unit_testobj.cxxflags = ['-DPACKAGE="libcanvastest"']
|
|
|
|
unit_testobj.cxxflags += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
|
|
|
|
unit_testobj.cxxflags += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFDIR']) + '"']
|
|
|
|
unit_testobj.cxxflags += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
|
2013-07-14 13:38:52 -04:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
manual_tests = '''
|
2013-07-14 13:38:52 -04:00
|
|
|
test/hello_world.cc
|
|
|
|
test/gtk_many.cc
|
|
|
|
test/gtk_scene.cc
|
|
|
|
test/gtk_movement.cc
|
|
|
|
test/gtk_viewport.cc
|
|
|
|
test/gtk_drag.cc
|
|
|
|
'''.split()
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
for t in manual_tests:
|
|
|
|
target = t[:-3]
|
|
|
|
name = t[t.find('/')+1:-3]
|
2016-02-28 15:16:44 -05:00
|
|
|
manual_testobj = bld(features = 'cxx cxxprogram')
|
2013-04-04 00:32:52 -04:00
|
|
|
manual_testobj.source = t
|
|
|
|
manual_testobj.includes = obj.includes + ['test', '../pbd']
|
|
|
|
manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
|
2017-07-17 14:12:33 -04:00
|
|
|
manual_testobj.uselib_local = 'libcanvas libgtkmm2ext'
|
2013-04-04 00:32:52 -04:00
|
|
|
manual_testobj.name = 'libcanvas-manual-test-%s' % name
|
|
|
|
manual_testobj.target = target
|
|
|
|
manual_testobj.install_path = ''
|
2015-11-29 11:52:42 -05:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
benchmarks = '''
|
2013-07-14 13:38:52 -04:00
|
|
|
benchmark/items_at_point.cc
|
|
|
|
benchmark/render_parts.cc
|
|
|
|
benchmark/render_from_log.cc
|
|
|
|
benchmark/render_whole.cc
|
|
|
|
'''.split()
|
2013-04-04 00:32:52 -04:00
|
|
|
|
|
|
|
for t in benchmarks:
|
|
|
|
target = t[:-3]
|
|
|
|
name = t[t.find('/')+1:-3]
|
2016-02-28 15:16:44 -05:00
|
|
|
manual_testobj = bld(features = 'cxx cxxprogram')
|
2013-04-04 00:32:52 -04:00
|
|
|
manual_testobj.source = [ t, 'benchmark/benchmark.cc' ]
|
|
|
|
manual_testobj.includes = obj.includes + ['test', '../pbd']
|
|
|
|
manual_testobj.uselib = 'CPPUNIT SIGCPP CAIROMM GTKMM'
|
2017-07-17 14:12:33 -04:00
|
|
|
manual_testobj.uselib_local = 'libcanvas libgtkmm2ext'
|
2013-04-04 00:32:52 -04:00
|
|
|
manual_testobj.name = 'libcanvas-benchmark-%s' % name
|
|
|
|
manual_testobj.target = target
|
|
|
|
manual_testobj.install_path = ''
|
|
|
|
|
2020-06-19 16:02:24 -04:00
|
|
|
|
2013-04-04 00:32:52 -04:00
|
|
|
def shutdown():
|
2013-07-14 13:38:52 -04:00
|
|
|
autowaf.shutdown()
|
2013-04-04 00:32:52 -04:00
|
|
|
|