Rename ReelMXF -> ReelFileAsset.
[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.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_file_asset.cc
86              reel_mono_picture_asset.cc
87              reel_picture_asset.cc
88              reel_markers_asset.cc
89              reel_sound_asset.cc
90              reel_stereo_picture_asset.cc
91              reel_subtitle_asset.cc
92              ref.cc
93              rgb_xyz.cc
94              s_gamut3_transfer_function.cc
95              smpte_load_font_node.cc
96              smpte_subtitle_asset.cc
97              sound_asset.cc
98              sound_asset_writer.cc
99              sound_frame.cc
100              stereo_picture_asset.cc
101              stereo_picture_asset_writer.cc
102              stereo_picture_frame.cc
103              subtitle.cc
104              subtitle_asset.cc
105              subtitle_asset_internal.cc
106              subtitle_image.cc
107              subtitle_string.cc
108              transfer_function.cc
109              types.cc
110              util.cc
111              verify.cc
112              version.cc
113              """
114
115     headers = """
116               array_data.h
117               asset.h
118               asset_reader.h
119               asset_writer.h
120               atmos_asset.h
121               atmos_asset_reader.h
122               atmos_asset_writer.h
123               atmos_frame.h
124               certificate_chain.h
125               certificate.h
126               chromaticity.h
127               colour_conversion.h
128               combine.h
129               compose.hpp
130               cpl.h
131               crypto_context.h
132               data.h
133               dcp.h
134               dcp_assert.h
135               dcp_time.h
136               decrypted_kdm.h
137               decrypted_kdm_key.h
138               encrypted_kdm.h
139               exceptions.h
140               font_asset.h
141               frame.h
142               fsk.h
143               gamma_transfer_function.h
144               identity_transfer_function.h
145               interop_load_font_node.h
146               interop_subtitle_asset.h
147               j2k.h
148               key.h
149               language_tag.h
150               load_font_node.h
151               local_time.h
152               locale_convert.h
153               metadata.h
154               mono_picture_asset.h
155               mono_picture_asset_reader.h
156               mono_picture_frame.h
157               modified_gamma_transfer_function.h
158               mxf.h
159               name_format.h
160               object.h
161               openjpeg_image.h
162               picture_asset.h
163               picture_asset_writer.h
164               pkl.h
165               raw_convert.h
166               rgb_xyz.h
167               reel.h
168               reel_asset.h
169               reel_atmos_asset.h
170               reel_closed_caption_asset.h
171               reel_markers_asset.h
172               reel_mono_picture_asset.h
173               reel_mxf.h
174               reel_picture_asset.h
175               reel_sound_asset.h
176               reel_stereo_picture_asset.h
177               reel_subtitle_asset.h
178               ref.h
179               s_gamut3_transfer_function.h
180               smpte_load_font_node.h
181               smpte_subtitle_asset.h
182               sound_frame.h
183               sound_asset.h
184               sound_asset_reader.h
185               sound_asset_writer.h
186               stereo_picture_asset.h
187               stereo_picture_asset_reader.h
188               stereo_picture_asset_writer.h
189               stereo_picture_frame.h
190               subtitle.h
191               subtitle_asset.h
192               subtitle_image.h
193               subtitle_string.h
194               transfer_function.h
195               types.h
196               util.h
197               verify.h
198               version.h
199               """
200
201     # Main library
202     if bld.env.STATIC:
203         obj = bld(features='cxx cxxstlib')
204     else:
205         obj = bld(features='cxx cxxshlib')
206     obj.name = 'libdcp%s' % bld.env.API_VERSION
207     obj.target = 'dcp%s' % bld.env.API_VERSION
208     obj.export_includes = ['.']
209     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
210     obj.source = source
211
212     # Library for gcov
213     if bld.is_defined('HAVE_GCOV'):
214         if bld.env.STATIC:
215             obj = bld(features='cxx cxxstlib')
216         else:
217             obj = bld(features='cxx cxxshlib')
218         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
219         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
220         obj.export_includes = ['.']
221         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
222         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
223         obj.source = source
224         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
225
226     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
227     if bld.env.STATIC:
228         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)