Split ReelClosedCaptionAsset into Interop and SMPTE parts.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2020 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              array_data.cc
38              asset.cc
39              asset_factory.cc
40              asset_writer.cc
41              atmos_asset.cc
42              atmos_asset_writer.cc
43              bitstream.cc
44              certificate_chain.cc
45              certificate.cc
46              chromaticity.cc
47              colour_conversion.cc
48              combine.cc
49              cpl.cc
50              data.cc
51              dcp.cc
52              dcp_time.cc
53              decrypted_kdm.cc
54              decrypted_kdm_key.cc
55              encrypted_kdm.cc
56              exceptions.cc
57              font_asset.cc
58              fsk.cc
59              gamma_transfer_function.cc
60              identity_transfer_function.cc
61              interop_load_font_node.cc
62              interop_subtitle_asset.cc
63              j2k_transcode.cc
64              key.cc
65              language_tag.cc
66              local_time.cc
67              locale_convert.cc
68              metadata.cc
69              modified_gamma_transfer_function.cc
70              mono_picture_asset.cc
71              mono_picture_asset_writer.cc
72              mono_picture_frame.cc
73              mxf.cc
74              name_format.cc
75              object.cc
76              openjpeg_image.cc
77              picture_asset.cc
78              picture_asset_writer.cc
79              pkl.cc
80              raw_convert.cc
81              reel.cc
82              reel_asset.cc
83              reel_atmos_asset.cc
84              reel_closed_caption_asset.cc
85              reel_encryptable_asset.cc
86              reel_file_asset.cc
87              reel_interop_closed_caption_asset.cc
88              reel_interop_subtitle_asset.cc
89              reel_mono_picture_asset.cc
90              reel_picture_asset.cc
91              reel_markers_asset.cc
92              reel_smpte_closed_caption_asset.cc
93              reel_smpte_subtitle_asset.cc
94              reel_sound_asset.cc
95              reel_stereo_picture_asset.cc
96              reel_subtitle_asset.cc
97              ref.cc
98              rgb_xyz.cc
99              s_gamut3_transfer_function.cc
100              smpte_load_font_node.cc
101              smpte_subtitle_asset.cc
102              sound_asset.cc
103              sound_asset_writer.cc
104              sound_frame.cc
105              stereo_picture_asset.cc
106              stereo_picture_asset_writer.cc
107              stereo_picture_frame.cc
108              subtitle.cc
109              subtitle_asset.cc
110              subtitle_asset_internal.cc
111              subtitle_image.cc
112              subtitle_string.cc
113              transfer_function.cc
114              types.cc
115              util.cc
116              verify.cc
117              verify_j2k.cc
118              version.cc
119              """
120
121     headers = """
122               array_data.h
123               asset.h
124               asset_reader.h
125               asset_writer.h
126               atmos_asset.h
127               atmos_asset_reader.h
128               atmos_asset_writer.h
129               atmos_frame.h
130               certificate_chain.h
131               certificate.h
132               chromaticity.h
133               colour_conversion.h
134               combine.h
135               compose.hpp
136               cpl.h
137               crypto_context.h
138               data.h
139               dcp.h
140               dcp_assert.h
141               dcp_time.h
142               decrypted_kdm.h
143               decrypted_kdm_key.h
144               encrypted_kdm.h
145               exceptions.h
146               font_asset.h
147               frame.h
148               fsk.h
149               gamma_transfer_function.h
150               identity_transfer_function.h
151               interop_load_font_node.h
152               interop_subtitle_asset.h
153               j2k_transcode.h
154               key.h
155               language_tag.h
156               load_font_node.h
157               local_time.h
158               locale_convert.h
159               metadata.h
160               mono_picture_asset.h
161               mono_picture_asset_reader.h
162               mono_picture_frame.h
163               modified_gamma_transfer_function.h
164               mxf.h
165               name_format.h
166               object.h
167               openjpeg_image.h
168               picture_asset.h
169               picture_asset_writer.h
170               pkl.h
171               raw_convert.h
172               rgb_xyz.h
173               reel.h
174               reel_asset.h
175               reel_atmos_asset.h
176               reel_encryptable_asset.h
177               reel_file_asset.h
178               reel_interop_closed_caption_asset.h
179               reel_interop_subtitle_asset.h
180               reel_markers_asset.h
181               reel_mono_picture_asset.h
182               reel_picture_asset.h
183               reel_sound_asset.h
184               reel_smpte_closed_caption_asset.h
185               reel_smpte_subtitle_asset.h
186               reel_stereo_picture_asset.h
187               reel_subtitle_asset.h
188               ref.h
189               s_gamut3_transfer_function.h
190               smpte_load_font_node.h
191               smpte_subtitle_asset.h
192               sound_frame.h
193               sound_asset.h
194               sound_asset_reader.h
195               sound_asset_writer.h
196               stereo_picture_asset.h
197               stereo_picture_asset_reader.h
198               stereo_picture_asset_writer.h
199               stereo_picture_frame.h
200               subtitle.h
201               subtitle_asset.h
202               subtitle_image.h
203               subtitle_string.h
204               transfer_function.h
205               types.h
206               util.h
207               verify.h
208               verify_j2k.h
209               version.h
210               """
211
212     # Main library
213     if bld.env.STATIC:
214         obj = bld(features='cxx cxxstlib')
215     else:
216         obj = bld(features='cxx cxxshlib')
217     obj.name = 'libdcp%s' % bld.env.API_VERSION
218     obj.target = 'dcp%s' % bld.env.API_VERSION
219     obj.export_includes = ['.']
220     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
221     obj.source = source
222
223     # Library for gcov
224     if bld.is_defined('HAVE_GCOV'):
225         if bld.env.STATIC:
226             obj = bld(features='cxx cxxstlib')
227         else:
228             obj = bld(features='cxx cxxshlib')
229         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
230         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
231         obj.export_includes = ['.']
232         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
233         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
234         obj.source = source
235         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
236
237     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
238     if bld.env.STATIC:
239         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)