In-line run of subs_in_out so that it gets the environment more easily.
[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              ruby.cc
105              s_gamut3_transfer_function.cc
106              search.cc
107              smpte_load_font_node.cc
108              smpte_subtitle_asset.cc
109              sound_asset.cc
110              sound_asset_writer.cc
111              sound_frame.cc
112              stereo_picture_asset.cc
113              stereo_picture_asset_writer.cc
114              stereo_picture_frame.cc
115              subtitle.cc
116              subtitle_asset.cc
117              subtitle_asset_internal.cc
118              subtitle_image.cc
119              subtitle_standard.cc
120              subtitle_string.cc
121              transfer_function.cc
122              types.cc
123              utc_offset.cc
124              util.cc
125              v_align.cc
126              verify.cc
127              verify_j2k.cc
128              version.cc
129              """
130
131     headers = """
132               array_data.h
133               asset.h
134               asset_list.h
135               asset_map.h
136               asset_reader.h
137               asset_writer.h
138               atmos_asset.h
139               atmos_asset_reader.h
140               atmos_asset_writer.h
141               atmos_frame.h
142               certificate_chain.h
143               certificate.h
144               chromaticity.h
145               colour_conversion.h
146               combine.h
147               compose.hpp
148               content_kind.h
149               cpl.h
150               crypto_context.h
151               data.h
152               dcp.h
153               dcp_assert.h
154               dcp_time.h
155               decrypted_kdm.h
156               decrypted_kdm_key.h
157               encrypted_kdm.h
158               equality_options.h
159               exceptions.h
160               file.h
161               filesystem.h
162               font_asset.h
163               frame.h
164               fsk.h
165               gamma_transfer_function.h
166               h_align.h
167               identity_transfer_function.h
168               interop_load_font_node.h
169               interop_subtitle_asset.h
170               j2k_transcode.h
171               key.h
172               language_tag.h
173               load_font_node.h
174               local_time.h
175               locale_convert.h
176               metadata.h
177               mono_picture_asset.h
178               mono_picture_asset_reader.h
179               mono_picture_asset_writer.h
180               mono_picture_frame.h
181               modified_gamma_transfer_function.h
182               mxf.h
183               name_format.h
184               object.h
185               openjpeg_image.h
186               picture_asset.h
187               picture_asset_writer.h
188               piecewise_lut.h
189               pkl.h
190               rating.h
191               raw_convert.h
192               rgb_xyz.h
193               reel.h
194               reel_asset.h
195               reel_atmos_asset.h
196               reel_closed_caption_asset.h
197               reel_file_asset.h
198               reel_interop_closed_caption_asset.h
199               reel_interop_subtitle_asset.h
200               reel_markers_asset.h
201               reel_mono_picture_asset.h
202               reel_picture_asset.h
203               reel_sound_asset.h
204               reel_smpte_closed_caption_asset.h
205               reel_smpte_subtitle_asset.h
206               reel_stereo_picture_asset.h
207               reel_subtitle_asset.h
208               ref.h
209               ruby.h
210               s_gamut3_transfer_function.h
211               scope_guard.h
212               search.h
213               smpte_load_font_node.h
214               smpte_subtitle_asset.h
215               sound_frame.h
216               sound_asset.h
217               sound_asset_reader.h
218               sound_asset_writer.h
219               stereo_picture_asset.h
220               stereo_picture_asset_reader.h
221               stereo_picture_asset_writer.h
222               stereo_picture_frame.h
223               subtitle.h
224               subtitle_asset.h
225               subtitle_image.h
226               subtitle_standard.h
227               subtitle_string.h
228               transfer_function.h
229               types.h
230               utc_offset.h
231               util.h
232               v_align.h
233               verify.h
234               verify_j2k.h
235               version.h
236               warnings.h
237               """
238
239     # Main library
240     if bld.env.STATIC:
241         obj = bld(features='cxx cxxstlib')
242     else:
243         obj = bld(features='cxx cxxshlib')
244     obj.name = 'libdcp%s' % bld.env.API_VERSION
245     obj.target = 'dcp%s' % bld.env.API_VERSION
246     obj.export_includes = ['.']
247     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
248     obj.source = source
249
250     # Library for gcov
251     if bld.is_defined('HAVE_GCOV'):
252         if bld.env.STATIC:
253             obj = bld(features='cxx cxxstlib')
254         else:
255             obj = bld(features='cxx cxxshlib')
256         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
257         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
258         obj.export_includes = ['.']
259         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_CTH XERCES'
260         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
261         obj.source = source
262         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
263
264     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
265     if bld.env.STATIC:
266         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)