Add Reader classes to permit much more efficient DCP reading.
[libdcp.git] / src / wscript
1 #
2 #    Copyright (C) 2012-2016 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
19 from waflib import TaskGen
20
21 def build(bld):
22     source = """
23              asset.cc
24              asset_reader.cc
25              asset_writer.cc
26              atmos_asset.cc
27              certificate_chain.cc
28              certificate.cc
29              colour_conversion.cc
30              colour_matrix.cc
31              cpl.cc
32              data.cc
33              dcp.cc
34              dcp_time.cc
35              decrypted_kdm.cc
36              decrypted_kdm_key.cc
37              encrypted_kdm.cc
38              exceptions.cc
39              file.cc
40              font_asset.cc
41              font_node.cc
42              gamma_transfer_function.cc
43              interop_load_font_node.cc
44              interop_subtitle_asset.cc
45              j2k.cc
46              key.cc
47              local_time.cc
48              metadata.cc
49              modified_gamma_transfer_function.cc
50              mono_picture_asset.cc
51              mono_picture_asset_reader.cc
52              mono_picture_asset_writer.cc
53              mono_picture_frame.cc
54              mxf.cc
55              object.cc
56              openjpeg_image.cc
57              picture_asset.cc
58              picture_asset_writer.cc
59              reel.cc
60              reel_asset.cc
61              reel_atmos_asset.cc
62              reel_mono_picture_asset.cc
63              reel_mxf.cc
64              reel_picture_asset.cc
65              reel_sound_asset.cc
66              reel_stereo_picture_asset.cc
67              reel_subtitle_asset.cc
68              ref.cc
69              rgb_xyz.cc
70              smpte_load_font_node.cc
71              smpte_subtitle_asset.cc
72              sound_asset.cc
73              sound_asset_reader.cc
74              sound_asset_writer.cc
75              sound_frame.cc
76              stereo_picture_asset.cc
77              stereo_picture_asset_reader.cc
78              stereo_picture_asset_writer.cc
79              stereo_picture_frame.cc
80              subtitle_node.cc
81              subtitle_asset.cc
82              subtitle_string.cc
83              text_node.cc
84              transfer_function.cc
85              types.cc
86              util.cc
87              version.cc
88              """
89
90     headers = """
91               asset.h
92               asset_reader.h
93               asset_writer.h
94               atmos_asset.h
95               certificate_chain.h
96               certificate.h
97               chromaticity.h
98               colour_conversion.h
99               colour_matrix.h
100               cpl.h
101               dcp.h
102               dcp_time.h
103               data.h
104               decrypted_kdm.h
105               decrypted_kdm_key.h
106               encrypted_kdm.h
107               exceptions.h
108               font_asset.h
109               gamma_transfer_function.h
110               interop_load_font_node.h
111               interop_subtitle_asset.h
112               j2k.h
113               key.h
114               load_font_node.h
115               local_time.h
116               metadata.h
117               mono_picture_asset.h
118               mono_picture_asset_reader.h
119               mono_picture_frame.h
120               modified_gamma_transfer_function.h
121               mxf.h
122               object.h
123               openjpeg_image.h
124               picture_asset.h
125               picture_asset_writer.h
126               raw_convert.h
127               rgb_xyz.h
128               reel.h
129               reel_asset.h
130               reel_atmos_asset.h
131               reel_mono_picture_asset.h
132               reel_mxf.h
133               reel_picture_asset.h
134               reel_sound_asset.h
135               reel_stereo_picture_asset.h
136               reel_subtitle_asset.h
137               ref.h
138               smpte_load_font_node.h
139               smpte_subtitle_asset.h
140               sound_frame.h
141               sound_asset.h
142               sound_asset_reader.h
143               sound_asset_writer.h
144               stereo_picture_asset.h
145               stereo_picture_asset_reader.h
146               stereo_picture_asset_writer.h
147               stereo_picture_frame.h
148               subtitle_node.h
149               subtitle_asset.h
150               subtitle_string.h
151               transfer_function.h
152               types.h
153               util.h
154               version.h
155               """
156
157     # Main library
158     if bld.env.STATIC:
159         obj = bld(features='cxx cxxstlib')
160     else:
161         obj = bld(features='cxx cxxshlib')
162     obj.name = 'libdcp%s' % bld.env.API_VERSION
163     obj.target = 'dcp%s' % bld.env.API_VERSION
164     obj.export_includes = ['.']
165     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
166     obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
167     obj.source = source
168
169     # Library for gcov
170     if bld.is_defined('HAVE_GCOV'):
171         obj = bld(features='cxx cxxstlib')
172         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
173         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
174         obj.export_includes = ['.']
175         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH'
176         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
177         obj.source = source
178         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
179
180     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
181     if bld.env.STATIC:
182         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)