d6444aee507b049b853884de2a9ebd313b0d8b8b
[libdcp.git] / src / wscript
1 from waflib import TaskGen
2
3 def build(bld):
4     source = """
5              argb_frame.cc
6              asset.cc
7              certificate_chain.cc
8              certificates.cc
9              colour_conversion.cc
10              colour_matrix.cc
11              content.cc
12              cpl.cc
13              dcp.cc        
14              dcp_time.cc
15              decrypted_kdm.cc
16              decrypted_kdm_key.cc
17              encrypted_kdm.cc
18              exceptions.cc
19              file.cc
20              font.cc
21              gamma_transfer_function.cc
22              image.cc
23              interop_load_font.cc
24              interop_subtitle_content.cc
25              key.cc
26              local_time.cc
27              metadata.cc
28              modified_gamma_transfer_function.cc
29              mono_picture_mxf.cc
30              mono_picture_mxf_writer.cc
31              mono_picture_frame.cc
32              mxf.cc
33              mxf_writer.cc
34              object.cc
35              picture_mxf.cc
36              picture_mxf_writer.cc
37              reel.cc
38              reel_asset.cc
39              reel_mono_picture_asset.cc
40              reel_mxf_asset.cc
41              reel_picture_asset.cc
42              reel_sound_asset.cc
43              reel_stereo_picture_asset.cc
44              reel_subtitle_asset.cc
45              rgb_xyz.cc
46              signer.cc
47              smpte_load_font.cc
48              smpte_subtitle_content.cc
49              sound_mxf.cc
50              sound_mxf_writer.cc
51              sound_frame.cc
52              stereo_picture_mxf.cc
53              stereo_picture_mxf_writer.cc
54              stereo_picture_frame.cc
55              subtitle.cc
56              subtitle_content.cc
57              subtitle_string.cc
58              text.cc
59              transfer_function.cc
60              types.cc
61              util.cc
62              version.cc
63              xyz_frame.cc
64              """
65
66     headers = """
67               asset.h
68               certificate_chain.h
69               certificates.h
70               colour_conversion.h
71               colour_matrix.h
72               cpl.h
73               content.h
74               dcp.h
75               dcp_time.h
76               decrypted_kdm.h
77               decrypted_kdm_key.h
78               encrypted_kdm.h
79               exceptions.h
80               gamma_transfer_function.h
81               image.h
82               interop_load_font.h
83               interop_subtitle_content.h
84               key.h
85               load_font.h
86               local_time.h
87               metadata.h
88               mono_picture_mxf.h
89               mono_picture_frame.h
90               modified_gamma_transfer_function.h
91               mxf.h
92               mxf_writer.h
93               object.h
94               picture_mxf.h
95               picture_mxf_writer.h
96               raw_convert.h
97               rgb_xyz.h
98               reel.h
99               reel_asset.h
100               reel_mono_picture_asset.h
101               reel_mxf_asset.h
102               reel_picture_asset.h
103               reel_sound_asset.h
104               reel_stereo_picture_asset.h
105               reel_subtitle_asset.h
106               ref.h
107               argb_frame.h
108               signer.h
109               smpte_load_font.h
110               smpte_subtitle_content.h
111               sound_frame.h
112               sound_mxf.h
113               sound_mxf_writer.h
114               stereo_picture_mxf.h
115               stereo_picture_frame.h
116               subtitle.h
117               subtitle_content.h
118               subtitle_string.h
119               transfer_function.h
120               types.h
121               util.h
122               version.h
123               xyz_frame.h
124               """
125
126     # Main library
127     if bld.env.STATIC:
128         obj = bld(features='cxx cxxstlib')
129     else:
130         obj = bld(features='cxx cxxshlib')
131     obj.name = 'libdcp%s' % bld.env.API_VERSION
132     obj.target = 'dcp%s' % bld.env.API_VERSION
133     obj.export_includes = ['.']
134     obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1'
135     obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
136     obj.source = source
137
138     # Library for gcov
139     if bld.is_defined('HAVE_GCOV'):
140         obj = bld(features='cxx cxxstlib')
141         obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION
142         obj.target = 'dcp%s_gcov' % bld.env.API_VERSION
143         obj.export_includes = ['.']
144         obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1'
145         obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
146         obj.source = source
147         obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
148
149     bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers)
150     if bld.env.STATIC:
151         bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)