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