Allow creation of ATMOS sync on channel 14.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
3 #
4 #    This program is free software; you can redistribute it and/or modify
5 #    it under the terms of the GNU General Public License as published by
6 #    the Free Software Foundation; either version 2 of the License, or
7 #    (at your option) any later version.
8 #
9 #    This program is distributed in the hope that it will be useful,
10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #    GNU General Public License for more details.
13 #
14 #    You should have received a copy of the GNU General Public License
15 #    along with this program; if not, write to the Free Software
16 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18 #    In addition, as a special exception, the copyright holders give
19 #    permission to link the code of portions of this program with the
20 #    OpenSSL library under certain conditions as described in each
21 #    individual source file, and distribute linked combinations
22 #    including the two.
23 #
24 #    You must obey the GNU General Public License in all respects
25 #    for all of the code used other than OpenSSL.  If you modify
26 #    file(s) with this exception, you may extend this exception to your
27 #    version of the file(s), but you are not obligated to do so.  If you
28 #    do not wish to do so, delete this exception statement from your
29 #    version.  If you delete this exception statement from all source
30 #    files in the program, then also delete it here.
31 #
32
33 from waflib import TaskGen
34
35 def build(bld):
36     source = """
37              asset.cc
38              asset_factory.cc
39              asset_writer.cc
40              atmos_asset.cc
41              atmos_asset_writer.cc
42              bitstream.cc
43              certificate_chain.cc
44              certificate.cc
45              chromaticity.cc
46              colour_conversion.cc
47              cpl.cc
48              data.cc
49              dcp.cc
50              dcp_time.cc
51              decrypted_kdm.cc
52              decrypted_kdm_key.cc
53              encrypted_kdm.cc
54              exceptions.cc
55              file.cc
56              font_asset.cc
57              fsk.cc
58              gamma_transfer_function.cc
59              identity_transfer_function.cc
60              interop_load_font_node.cc
61              interop_subtitle_asset.cc
62              j2k.cc
63              key.cc
64              local_time.cc
65              locale_convert.cc
66              metadata.cc
67              modified_gamma_transfer_function.cc
68              mono_picture_asset.cc
69              mono_picture_asset_writer.cc
70              mono_picture_frame.cc
71              mxf.cc
72              name_format.cc
73              object.cc
74              openjpeg_image.cc
75              picture_asset.cc
76              picture_asset_writer.cc
77              pkl.cc
78              raw_convert.cc
79              reel.cc
80              reel_asset.cc
81              reel_atmos_asset.cc
82              reel_closed_caption_asset.cc
83              reel_mono_picture_asset.cc
84              reel_mxf.cc
85              reel_picture_asset.cc
86              reel_markers_asset.cc
87              reel_sound_asset.cc
88              reel_stereo_picture_asset.cc
89              reel_subtitle_asset.cc
90              ref.cc
91              rgb_xyz.cc
92              s_gamut3_transfer_function.cc
93              smpte_load_font_node.cc
94              smpte_subtitle_asset.cc
95              sound_asset.cc
96              sound_asset_writer.cc
97              sound_frame.cc
98              stereo_picture_asset.cc
99              stereo_picture_asset_writer.cc
100              stereo_picture_frame.cc
101              subtitle.cc
102              subtitle_asset.cc
103              subtitle_asset_internal.cc
104              subtitle_image.cc
105              subtitle_string.cc
106              transfer_function.cc
107              types.cc
108              util.cc
109              verify.cc
110              version.cc
111              """
112
113     headers = """
114               asset.h
115               asset_reader.h
116               asset_writer.h
117               atmos_asset.h
118               atmos_asset_reader.h
119               atmos_asset_writer.h
120               atmos_frame.h
121               certificate_chain.h
122               certificate.h
123               chromaticity.h
124               colour_conversion.h
125               cpl.h
126               crypto_context.h
127               dcp.h
128               dcp_assert.h
129               dcp_time.h
130               data.h
131               decrypted_kdm.h
132               decrypted_kdm_key.h
133               encrypted_kdm.h
134               exceptions.h
135               font_asset.h
136               frame.h
137               fsk.h
138               gamma_transfer_function.h
139               identity_transfer_function.h
140               interop_load_font_node.h
141               interop_subtitle_asset.h
142               j2k.h
143               key.h
144               load_font_node.h
145               local_time.h
146               locale_convert.h
147               metadata.h
148               mono_picture_asset.h
149               mono_picture_asset_reader.h
150               mono_picture_frame.h
151               modified_gamma_transfer_function.h
152               mxf.h
153               name_format.h
154               object.h
155               openjpeg_image.h
156               picture_asset.h
157               picture_asset_writer.h
158               pkl.h
159               raw_convert.h
160               rgb_xyz.h
161               reel.h
162               reel_asset.h
163               reel_atmos_asset.h
164               reel_closed_caption_asset.h
165               reel_markers_asset.h
166               reel_mono_picture_asset.h
167               reel_mxf.h
168               reel_picture_asset.h
169               reel_sound_asset.h
170               reel_stereo_picture_asset.h
171               reel_subtitle_asset.h
172               ref.h
173               s_gamut3_transfer_function.h
174               smpte_load_font_node.h
175               smpte_subtitle_asset.h
176               sound_frame.h
177               sound_asset.h
178               sound_asset_reader.h
179               sound_asset_writer.h
180               stereo_picture_asset.h
181               stereo_picture_asset_reader.h
182               stereo_picture_asset_writer.h
183               stereo_picture_frame.h
184               subtitle.h
185               subtitle_asset.h
186               subtitle_image.h
187               subtitle_string.h
188               transfer_function.h
189               types.h
190               util.h
191               verify.h
192               version.h
193               """
194
195     # Main library
196     if bld.env.STATIC:
197         obj = bld(features='cxx cxxstlib')
198     else:
199         obj = bld(features='cxx cxxshlib')
200     obj.name = 'libdcp%s' % bld.env.API_VERSION
201     obj.target = 'dcp%s' % bld.env.API_VERSION
202     obj.export_includes = ['.']
203     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
204     obj.source = source
205
206     # Library for gcov
207     if bld.is_defined('HAVE_GCOV'):
208         if bld.env.STATIC:
209             obj = bld(features='cxx cxxstlib')
210         else:
211             obj = bld(features='cxx cxxshlib')
212         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
213         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
214         obj.export_includes = ['.']
215         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
216         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
217         obj.source = source
218         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
219
220     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
221     if bld.env.STATIC:
222         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)