from waflib import TaskGen def build(bld): source = """ asset.cc certificate_chain.cc certificates.cc colour_conversion.cc colour_matrix.cc content.cc cpl.cc dcp.cc dcp_time.cc decrypted_kdm.cc decrypted_kdm_key.cc encrypted_kdm.cc exceptions.cc file.cc font.cc font_node.cc gamma_transfer_function.cc interop_load_font_node.cc interop_subtitle_content.cc key.cc local_time.cc metadata.cc modified_gamma_transfer_function.cc mono_picture_mxf.cc mono_picture_mxf_writer.cc mono_picture_frame.cc mxf.cc mxf_writer.cc object.cc picture_mxf.cc picture_mxf_writer.cc reel.cc reel_asset.cc reel_mono_picture_asset.cc reel_mxf_asset.cc reel_picture_asset.cc reel_sound_asset.cc reel_stereo_picture_asset.cc reel_subtitle_asset.cc rgb_xyz.cc signer.cc smpte_load_font_node.cc smpte_subtitle_content.cc sound_mxf.cc sound_mxf_writer.cc sound_frame.cc stereo_picture_mxf.cc stereo_picture_mxf_writer.cc stereo_picture_frame.cc subtitle_node.cc subtitle_content.cc subtitle_string.cc text_node.cc transfer_function.cc types.cc util.cc version.cc xyz_image.cc """ headers = """ asset.h certificate_chain.h certificates.h chromaticity.h colour_conversion.h colour_matrix.h cpl.h content.h dcp.h dcp_time.h decrypted_kdm.h decrypted_kdm_key.h encrypted_kdm.h exceptions.h font.h gamma_transfer_function.h interop_load_font_node.h interop_subtitle_content.h key.h load_font_node.h local_time.h metadata.h mono_picture_mxf.h mono_picture_frame.h modified_gamma_transfer_function.h mxf.h mxf_writer.h object.h picture_mxf.h picture_mxf_writer.h raw_convert.h rgb_xyz.h reel.h reel_asset.h reel_mono_picture_asset.h reel_mxf_asset.h reel_picture_asset.h reel_sound_asset.h reel_stereo_picture_asset.h reel_subtitle_asset.h ref.h signer.h smpte_load_font_node.h smpte_subtitle_content.h sound_frame.h sound_mxf.h sound_mxf_writer.h stereo_picture_mxf.h stereo_picture_frame.h subtitle_node.h subtitle_content.h subtitle_string.h transfer_function.h types.h util.h version.h xyz_image.h """ # Main library if bld.env.STATIC: obj = bld(features='cxx cxxstlib') else: obj = bld(features='cxx cxxshlib') obj.name = 'libdcp%s' % bld.env.API_VERSION obj.target = 'dcp%s' % bld.env.API_VERSION obj.export_includes = ['.'] obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1' obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION) obj.source = source # Library for gcov if bld.is_defined('HAVE_GCOV'): obj = bld(features='cxx cxxstlib') obj.name = 'libdcp%s_gcov' % bld.env.API_VERSION obj.target = 'dcp%s_gcov' % bld.env.API_VERSION obj.export_includes = ['.'] obj.uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1' obj.use = 'libkumu-libdcp%s libasdcp-libdcp%s' % (bld.env.API_VERSION, bld.env.API_VERSION) obj.source = source obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0'] bld.install_files('${PREFIX}/include/libdcp%s/dcp' % bld.env.API_VERSION, headers) if bld.env.STATIC: bld.install_files('${PREFIX}/lib', 'libdcp%s.a' % bld.env.API_VERSION)