This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
wscript
148 lines (123 loc) · 5.41 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/evn python
# encoding: utf-8
# Copyright (C) 2019 Michael Fisher <[email protected]>
import sys, os, platform
from subprocess import call
from waflib.extras import autowaf as autowaf
from waflib.extras import juce as juce
APPNAME = 'jlv2'
VERSION = '0.1.0'
top = '.'
out = 'build'
def options (opts):
autowaf.set_options (opts)
opts.load ('compiler_c compiler_cxx autowaf juce')
def silence_warnings (conf):
# TODO: update LV2 module to use latest LV2 / LILV / SUIL
conf.env.append_unique ('CXXFLAGS', ['-Wno-deprecated-declarations'])
def configure (conf):
conf.load ('compiler_c compiler_cxx autowaf')
silence_warnings (conf)
conf.env.DEBUG = conf.options.debug
# Write out the version header
conf.define ("JLV2_VERSION_STRING", VERSION)
conf.write_config_header ('jlv2/version.h', 'JLV2_VERSION_H')
for jmod in [ 'juce_audio_processors', 'juce_data_structures',
'juce_audio_devices', 'juce_audio_utils',
'juce_gui_extra' ]:
pkgname = '%s_debug-5' % jmod if conf.options.debug else '%s-5' % jmod
conf.check_cfg (package=pkgname, uselib_store=jmod.upper(),
args=['%s >= 5.4.5' % pkgname, '--libs', '--cflags'], mandatory=True)
conf.check_cfg (package='lv2', uselib_store='LV2',
args=['--libs', '--cflags'], mandatory=True)
conf.check_cfg (package='lilv-0', uselib_store='LILV',
args=['--libs', '--cflags'], mandatory=True)
conf.check_cfg (package='suil-0', uselib_store='SUIL',
args=['--libs', '--cflags'], mandatory=True)
conf.check_cfg (package='gtk+-2.0', uselib_store='GTK',
args='--cflags --libs', mandatory=False)
conf.define('JUCE_MODULE_AVAILABLE_jlv2_host', True)
conf.write_config_header ('jlv2/config.h', 'JLV2_MODULES_CONFIG_H')
conf.load ('juce')
conf.check_cxx_version ('c++14', True)
conf.env.append_unique ('CFLAGS', ['-fvisibility=hidden'])
conf.env.append_unique ('CXXFLAGS', ['-fvisibility=hidden'])
print
juce.display_header ("JLV2")
juce.display_msg (conf, 'Version', VERSION)
juce.display_msg (conf, 'Debug', conf.env.DEBUG)
if juce.is_mac():
print
juce.display_header ('Mac Options')
juce.display_msg (conf, 'OSX Arch', conf.env.ARCH)
juce.display_msg (conf, 'OSX Min Version', conf.options.mac_version_min if len(conf.options.mac_version_min) else 'default')
juce.display_msg (conf, 'OSX SDK', conf.options.mac_sdk if len(conf.options.mac_sdk) else 'default')
print
juce.display_header ('Compiler')
juce.display_msg (conf, 'CFLAGS', conf.env.CFLAGS)
juce.display_msg (conf, 'CXXFLAGS', conf.env.CXXFLAGS)
juce.display_msg (conf, 'LDFLAGS', conf.env.LINKFLAGS)
def library_slug (bld):
return 'jlv2_debug-0' if bld.env.DEBUG else 'jlv2-0'
def get_include_path (bld, subpath=''):
ip = '%s/jlv2-%s' % (bld.env.INCLUDEDIR, '0')
ip = os.path.join (ip, subpath) if len(subpath) > 0 else ip
return ip
def install_misc_header (bld, header, subpath=''):
destination = get_include_path (bld, subpath)
bld.install_files (destination, header)
def maybe_install_headers (bld):
for header in [ 'build/jlv2/jlv2.h', 'build/jlv2/config.h', 'build/jlv2/version.h' ]:
install_misc_header (bld, header, 'jlv2')
bld.install_files (get_include_path (bld),
bld.path.ant_glob ("modules/**/*.*"),
relative_trick=True,
cwd=bld.path.find_dir ('modules'))
def build (bld):
bld (
features = 'subst',
source = [ 'jlv2.h.in' ],
target = 'jlv2/jlv2.h',
install_path = None,
name = 'JLV2_HEADER'
)
bld.add_group()
library = bld (
features = 'cxx cxxshlib',
source = [ 'src/include_jlv2_host.cpp' ],
includes = [ 'build', 'modules' ],
name = 'JLV2',
target = 'lib/%s' % library_slug (bld),
use = [ 'JLV2_HEADER', 'JUCE_AUDIO_PROCESSORS',
'JUCE_DATA_STRUCTURES', 'JUCE_GUI_EXTRA',
'LILV', 'SUIL', 'GTK' ],
vnum = VERSION
)
pcobj = bld (
features = 'subst',
source = 'jlv2.pc.in',
target = '%s.pc' % library_slug (bld),
install_path = bld.env.LIBDIR + '/pkgconfig',
env = bld.env.derive(),
MAJOR_VERSION = '0',
PREFIX = bld.env.PREFIX,
INCLUDEDIR = bld.env.INCLUDEDIR,
LIBDIR = bld.env.LIBDIR,
CFLAGSS = [],
DEPLIBS = '-l%s' % library_slug (bld),
REQUIRED = '',
VERSION = VERSION
)
pcobj.env.CXXFLAGS = pcobj.env.CFLAGS = [] #
pcobj.REQUIRED += 'juce_audio_processors_debug-5 ' if bld.env.DEBUG else 'juce_audio_processors-5 '
pcobj.REQUIRED += 'juce_data_structures_debug-5 ' if bld.env.DEBUG else 'juce_data_structures-5 '
if bld.env.HAVE_SUIL: pcobj.REQUIRED += 'suil-0 '
if bld.env.HAVE_LILV: pcobj.REQUIRED += 'lilv-0 '
lv2show = bld.program (
source = [ 'tools/lv2show.cpp' ],
includes = [ 'modules' ],
target = 'bin/lv2show',
use = [ 'JLV2', 'JUCE_AUDIO_UTILS', 'JUCE_AUDIO_DEVICES' ],
install_path = None
)
maybe_install_headers (bld)