Fix uninitialised variable; Win32 build fixes.
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Nov 2015 19:42:14 +0000 (19:42 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 17 Nov 2015 21:00:45 +0000 (21:00 +0000)
asdcplib/src/KM_tai.cpp
cscript
test/wscript
wscript

index 2cbd1253dcaaba8f37be38ae300619e3a64df1f7..509e863251186ca3d60c955a0517ad8d1c1abdb4 100644 (file)
@@ -190,6 +190,7 @@ Kumu::TAI::tai::now()
   ct.hour = st.wHour;
   ct.minute = st.wMinute;
   ct.second = st.wSecond;
+  ct.offset = 0;
   caltime_tai(&ct, this);
 #else
   struct timeval now;
diff --git a/cscript b/cscript
index 4141b56cc53ccf01dfcdaee0a1fc552b5012e46e..1e0e234412086e6224051cb4f7c602133c760a4d 100644 (file)
--- a/cscript
+++ b/cscript
@@ -12,7 +12,7 @@ def build(target, options):
         if (target.distro == 'debian' and target.version == 'unstable' or target.distro == 'fedora' and target.version == '23'):
             target.append_with_space('CXXFLAGS', '-std=c++11')
     elif target.platform == 'windows':
-        cmd += ' --target-windows'
+        cmd += ' --target-windows --disable-gcov'
     elif target.platform == 'osx':
         cmd += ' --disable-tests'
 
index 89bf2fb28940b641c39cde088d5265005f8dbb76..707b776fc78b8499fc103b28369f37b55ba39753 100644 (file)
@@ -9,9 +9,9 @@ def configure(conf):
                            #include <boost/test/unit_test.hpp>\n
                             int main() {}
                             """,
-                              msg='Checking for boost unit testing library',
-                              lib='boost_unit_test_framework%s' % boost_lib_suffix,
-                              uselib_store='BOOST_TEST')
+                   msg='Checking for boost unit testing library',
+                   lib='boost_unit_test_framework%s' % boost_lib_suffix,
+                   uselib_store='BOOST_TEST')
 
     conf.env.prepend_value('LINKFLAGS', '-Lsrc')
 
@@ -19,9 +19,12 @@ def build(bld):
     obj = bld(features='cxx cxxprogram')
     obj.name   = 'tests'
     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML XMLSEC1 SNDFILE'
+    obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
     if bld.is_defined('HAVE_GCOV'):
         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
         obj.lib = ['gcov']
+        obj.cppflags.append('-ftest-coverage')
+        obj.cppflags.append('-fprofile-arcs')
     else:
         obj.use = 'libdcp%s' % bld.env.API_VERSION
     obj.source = """
@@ -57,30 +60,33 @@ def build(bld):
                  """
     obj.target = 'tests'
     obj.install_path = ''
-    obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
 
     obj = bld(features='cxx cxxprogram')
     obj.name   = 'subs_in_out'
     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
+    obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
     if bld.is_defined('HAVE_GCOV'):
         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
         obj.lib = ['gcov']
+        obj.cppflags.append('-ftest-coverage')
+        obj.cppflags.append('-fprofile-arcs')
     else:
         obj.use = 'libdcp%s' % bld.env.API_VERSION
     obj.source = 'subs_in_out.cc'
     obj.target = 'subs_in_out'
     obj.install_path = ''
-    obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
 
     obj = bld(features='cxx cxxprogram')
     obj.name   = 'rewrite_subs'
     obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
+    obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
     if bld.is_defined('HAVE_GCOV'):
         obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
         obj.lib = ['gcov']
+        obj.cppflags.append('-ftest-coverage')
+        obj.cppflags.append('-fprofile-arcs')
     else:
         obj.use = 'libdcp%s' % bld.env.API_VERSION
     obj.source = 'rewrite_subs.cc'
     obj.target = 'rewrite_subs'
     obj.install_path = ''
-    obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
diff --git a/wscript b/wscript
index b87022f6cd8fc8093be18f2a4306315309f34c6d..3c475848edc906c92d3b3835ce257d997008040e 100644 (file)
--- a/wscript
+++ b/wscript
@@ -14,6 +14,7 @@ def options(opt):
     opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
     opt.add_option('--static', action='store_true', default=False, help='build libdcp and in-tree dependencies statically, and link statically to openjpeg and cxml')
     opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
+    opt.add_option('--disable-gcov', action='store_true', default=False, help='don''t use gcov in tests')
     opt.add_option('--disable-examples', action='store_true', default=False, help='disable building of examples')
 
 def configure(conf):
@@ -122,7 +123,8 @@ def configure(conf):
 
     if not conf.env.DISABLE_TESTS:
         conf.recurse('test')
-        conf.check(lib='gcov', define_name='HAVE_GCOV', mandatory=False)
+        if not conf.options.disable_gcov:
+            conf.check(lib='gcov', define_name='HAVE_GCOV', mandatory=False)
     conf.recurse('asdcplib')
 
 def build(bld):