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