First bits of audio support.
[dcpomatic.git] / src / lib / wscript
1 #
2 #    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
3 #
4 #    This file is part of DCP-o-matic.
5 #
6 #    DCP-o-matic is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    DCP-o-matic is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 import os
21 import i18n
22
23 sources = """
24           analyse_audio_job.cc
25           atmos_mxf_content.cc
26           audio_analysis.cc
27           audio_buffers.cc
28           audio_content.cc
29           audio_decoder.cc
30           audio_delay.cc
31           audio_filter.cc
32           audio_filter_graph.cc
33           audio_mapping.cc
34           audio_merger.cc
35           audio_point.cc
36           audio_processor.cc
37           audio_ring_buffers.cc
38           audio_stream.cc
39           butler.cc
40           case_insensitive_sorter.cc
41           cinema.cc
42           cinema_kdms.cc
43           cinema_sound_processor.cc
44           colour_conversion.cc
45           config.cc
46           content.cc
47           content_factory.cc
48           cross.cc
49           curl_uploader.cc
50           dcp.cc
51           dcp_content.cc
52           dcp_content_type.cc
53           dcp_decoder.cc
54           dcp_examiner.cc
55           dcp_subtitle.cc
56           dcp_subtitle_content.cc
57           dcp_subtitle_decoder.cc
58           dcp_video.cc
59           dcpomatic_socket.cc
60           dcpomatic_time.cc
61           decoder.cc
62           decoder_factory.cc
63           decoder_part.cc
64           digester.cc
65           dolby_cp750.cc
66           emailer.cc
67           encoder.cc
68           encode_server.cc
69           encode_server_finder.cc
70           encoded_log_entry.cc
71           environment_info.cc
72           examine_content_job.cc
73           exceptions.cc
74           file_group.cc
75           file_log.cc
76           filter_graph.cc
77           ffmpeg.cc
78           ffmpeg_audio_stream.cc
79           ffmpeg_content.cc
80           ffmpeg_decoder.cc
81           ffmpeg_examiner.cc
82           ffmpeg_stream.cc
83           ffmpeg_subtitle_stream.cc
84           film.cc
85           filter.cc
86           font.cc
87           font_files.cc
88           frame_rate_change.cc
89           hints.cc
90           internet.cc
91           image.cc
92           image_content.cc
93           image_decoder.cc
94           image_examiner.cc
95           image_filename_sorter.cc
96           image_proxy.cc
97           isdcf_metadata.cc
98           j2k_image_proxy.cc
99           job.cc
100           job_manager.cc
101           json_server.cc
102           log.cc
103           log_entry.cc
104           magick_image_proxy.cc
105           mid_side_decoder.cc
106           overlaps.cc
107           player.cc
108           player_subtitles.cc
109           player_video.cc
110           playlist.cc
111           position_image.cc
112           ratio.cc
113           raw_image_proxy.cc
114           reel_writer.cc
115           render_subtitles.cc
116           resampler.cc
117           rgba.cc
118           scoped_temporary.cc
119           scp_uploader.cc
120           screen.cc
121           screen_kdm.cc
122           send_kdm_email_job.cc
123           send_problem_report_job.cc
124           server.cc
125           string_log_entry.cc
126           subtitle_content.cc
127           subtitle_decoder.cc
128           text_subtitle.cc
129           text_subtitle_content.cc
130           text_subtitle_decoder.cc
131           timer.cc
132           transcode_job.cc
133           transcoder.cc
134           types.cc
135           signal_manager.cc
136           update_checker.cc
137           upload_job.cc
138           uploader.cc
139           upmixer_a.cc
140           upmixer_b.cc
141           util.cc
142           video_content.cc
143           video_content_scale.cc
144           video_decoder.cc
145           video_filter_graph.cc
146           video_mxf_content.cc
147           video_mxf_decoder.cc
148           video_mxf_examiner.cc
149           video_ring_buffers.cc
150           writer.cc
151           """
152
153 def build(bld):
154     if bld.env.STATIC_DCPOMATIC:
155         obj = bld(features = 'cxx cxxstlib')
156     else:
157         obj = bld(features = 'cxx cxxshlib')
158
159     obj.name = 'libdcpomatic2'
160     obj.export_includes = ['..']
161     obj.uselib = """
162                  AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE
163                  BOOST_FILESYSTEM BOOST_THREAD BOOST_DATETIME BOOST_SIGNALS2 BOOST_REGEX
164                  SAMPLERATE POSTPROC TIFF MAGICK SSH DCP CXML GLIB LZMA XML++
165                  CURL ZIP FONTCONFIG PANGOMM CAIROMM XMLSEC SUB ICU NETTLE
166                  """
167
168     if bld.env.TARGET_OSX:
169         obj.framework = ['IOKit', 'Foundation']
170
171     obj.source = sources + ' version.cc'
172
173     if bld.env.TARGET_WINDOWS:
174         obj.uselib += ' WINSOCK2 BFD DBGHELP IBERTY SHLWAPI MSWSOCK BOOST_LOCALE'
175     if bld.env.STATIC_DCPOMATIC:
176         obj.uselib += ' XMLPP'
177
178     obj.target = 'dcpomatic2'
179
180     i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic2', bld)
181
182 def pot(bld):
183     i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic')
184
185 def pot_merge(bld):
186     i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic')